This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 234805 - [Ide/extbrowser] chrome setting opens firefox browser
Summary: [Ide/extbrowser] chrome setting opens firefox browser
Status: REOPENED
Alias: None
Product: ide
Classification: Unclassified
Component: Extbrowser (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Jan Stola
URL:
Keywords:
Depends on: 234988
Blocks:
  Show dependency tree
 
Reported: 2013-08-22 14:33 UTC by unai
Modified: 2015-01-28 13:48 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Tools -> Options -> General -> Web browser (5.51 KB, image/png)
2013-08-23 12:26 UTC, unai
Details
Window -> Web -> Web browser (40.25 KB, image/png)
2013-08-23 12:27 UTC, unai
Details
result (39.91 KB, image/png)
2013-08-23 12:27 UTC, unai
Details
NullPointerException (11.54 KB, image/png)
2013-08-23 12:31 UTC, unai
Details
NPE details (31.00 KB, image/png)
2013-08-23 12:32 UTC, unai
Details
log/messages.log (51.50 KB, application/octet-stream)
2013-08-23 12:35 UTC, unai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description unai 2013-08-22 14:33:36 UTC
[ BUILD # : 201307092200 ]
[ JDK VERSION : <1.7.0_21 ]

In the web browser setting in the Options window, on Windows Vista, the chrome
setting opens up the firefox browser. (w/clean
userdir)
Comment 1 Petr Jiricka 2013-08-22 15:03:50 UTC
Hi, what exactly you means "the chrome setting opens up"? What specific action do you use to open the browser? Can you please describe the full steps?
Comment 2 Vladimir Riha 2013-08-22 15:04:52 UTC
From issue 234734, I understood that you don't have Chrome installed on your system. Can you please also confirm it?
Comment 3 unai 2013-08-22 15:16:03 UTC
Sure:

How to reproduce:
- Open web browser from Window | Web | Web Browser

Preconditions:
- chrome is not installed in system
Comment 4 Petr Jiricka 2013-08-22 15:21:19 UTC
Tomas, can you please investigate?
Comment 5 Tomas Mysik 2013-08-23 05:05:15 UTC
I am not sure what is the issue here... On Windows XP, Firefox is opened for me (so no issue I guess). I will have a look at it once I have Windows Vista available for testing (on Tuesday).

@reporter: What is "chrome setting" please? Can you attach a screenshot what happens once you invoke Window > Web > Web Browser?

Thanks.

Product Version: NetBeans IDE Dev (Build 20130823-1f4ba288694d)
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: Linux version 3.8.0-27-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 6 unai 2013-08-23 12:26:21 UTC
Created attachment 139125 [details]
Tools -> Options -> General -> Web browser

Chrome
Comment 7 unai 2013-08-23 12:27:06 UTC
Created attachment 139126 [details]
Window -> Web -> Web browser
Comment 8 unai 2013-08-23 12:27:39 UTC
Created attachment 139127 [details]
result
Comment 9 unai 2013-08-23 12:30:47 UTC
However, whenever I change the browser setting I get a NPE (see attachments that will soon follow), so probably the Options window is showing Chrome but NB has still the Firefox setting in place (wherever it stores that info) because the last firefox->chrome switching raised a NPE?
Comment 10 unai 2013-08-23 12:31:38 UTC
Created attachment 139129 [details]
NullPointerException
Comment 11 unai 2013-08-23 12:32:11 UTC
Created attachment 139130 [details]
NPE details
Comment 12 unai 2013-08-23 12:35:09 UTC
Created attachment 139131 [details]
log/messages.log
Comment 13 Tomas Mysik 2013-08-26 05:56:25 UTC
I have reported the NPE as issue #234988. Let's wait for its fix, just to be sure that you are still able to reproduce this issue.

Thanks.
Comment 14 Tomas Mysik 2013-08-26 06:08:52 UTC
BTW thinking about it a bit more - what should happen if user selects a browser that is not installed on his system and invokes a browser? Options dialog for browsers should be opened? Or Options > General dialog where user can select a different/proper browser? Does anyone know?

Thanks.
Comment 15 Tomas Mysik 2013-08-26 08:39:40 UTC
Issue 234988 has already been fixed - could you please try the development version of NetBeans [1]?

Thanks.
[1] http://bits.netbeans.org/download/trunk/nightly/latest/
Comment 16 Petr Jiricka 2013-08-26 08:58:08 UTC
> BTW thinking about it a bit more - what should happen if user selects 
> a browser that is not installed on his system and invokes a browser?

I would say ideal solution would be to display a warning somewhere saying "Chrome is not installed on your machine, download it here". Since we want to promote use of Chrome (and NetBeans integration with Chrome), that's better than removing browsers that are not installed from the list (as reported by bug 223957).
Comment 17 unai 2013-08-26 19:36:50 UTC
With latest dev build, Chrome is still available as an option, but when set if you click "Window | Web | Web browser" instead of FireFox nothing opens (but "Opening browser..." still shows up in status bar)
Comment 18 Tomas Mysik 2013-08-28 07:01:45 UTC
(In reply to Petr Jiricka from comment #16)
> I would say ideal solution would be to display a warning somewhere saying
> "Chrome is not installed on your machine, download it here". Since we want
> to promote use of Chrome (and NetBeans integration with Chrome), that's
> better than removing browsers that are not installed from the list (as
> reported by bug 223957).

But user can select any browser, not only Chrome. I guess we should simply show something like "<Browser> is not installed" (likely in the status bar? or as a notification?).

Thanks.
Comment 19 Petr Jiricka 2013-08-28 08:01:06 UTC
Yes, sounds good, as long as this notification is noticeable.
Comment 20 Tomas Mysik 2013-08-28 09:55:49 UTC
Notification added. Please, could anyone verify it on OS X and Windows?

Thanks.

http://hg.netbeans.org/web-main/rev/b84e14b61710
Comment 21 Vladimir Riha 2013-08-28 10:01:39 UTC
I'll try it on both tomorrow.
Comment 22 Quality Engineering 2013-08-29 01:41:38 UTC
Integrated into 'main-silver', will be available in build *201308290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b84e14b61710
User: Tomas Mysik <tmysik@netbeans.org>
Log: #234805 - [Ide/extbrowser] chrome setting opens firefox browser
Comment 23 Vladimir Riha 2013-08-29 13:30:12 UTC
Seems to be OK to me on all platforms but Mac. Solution on Mac works only in case you run incorrect command, like

   google-chrome

But browsers in NetBeans on Mac are started using process

   /usr/bin/open

and some additional arguments, e.g.:

   /usr/bin/open -b com.google.chrome {URL}
   /usr/bin/open -a firefox {URL}
   /usr/bin/open -a safari {ULR}


where a is application name and b is application bundle identifier. So if you add custom browser and specify to use 

   /usr/bin/open -a myBrowser {URL}

and then run project, nothing happens (no notification). Another case (and this is naive approach as I'm not regular Mac user) I've tried was to click on the Browse button in Web Browser Manager dialog and select "Google Chrome.app" located in /Applications/Google Chrome.app (I can double click on this in common file manager to start browser), so the Process field contained

   /Applications/Google Chrome.app

and Arguments field contained {URL}. Now once I run this "browser", again nothing happened. But this is in reality a directory, so I tried 

   /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome

but again no feedback, nothing happened. This last command runs starts Chrome from command line







Product Version: NetBeans IDE Dev (Build 201308290001)
Java: 1.7.0_40; Java HotSpot(TM) Client VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 24 Tomas Mysik 2013-08-30 06:40:47 UTC
Petře, could you please investigate and possibly fix on OS X? I have no chance to debug it...

Thanks.
Comment 25 Petr Jiricka 2013-09-02 10:58:51 UTC
So far I found out that when I e.g. uninstall Opera and then run the following in the command line:
open -a opera http://www.seznam.cz/
The process returns exit code 1 and prints out:
Unable to find application named 'opera'

If I use a browser that is installed, nothing is printed out and I get exit code 0. So it looks like the fix could be to simply check exit value of the /usr/bin/open command.
Comment 26 unai 2014-01-09 18:34:39 UTC
Still experiencing issues with latest dev build (201401090002):

## GNU/Linux ##
On a linux box (Kubuntu 12.04 x64), with the following browsers installed:
- Konqueror (default)
- Dillo
- NetSurf
- ELinks

under Tools -> Options -> General -> Web Browser, the drop-down list shows:
- <Default System Browser>
- Firefox
- Mozilla
- Chrome

* With the latter three options I get the "Cannot run XXXXX" balloon.

* With the first option I get a popup from the OS saying "Could not find the program 'rekonq'" (well, maybe for this case there's a misconfiguration in the system -- where does NB actually look for the Default System Browser info?).

* FireFox, Mozilla and Chrome are listed but not installed.

* No Embedded WebKit Browser option (could it be because it's running over OpenJDK instead of Oracle's JDK -- thus no JavaFX WebKit browser?).

* Other installed browsers are not listed (not a big problem, they are minor browsers).

## Windows ##
On a windows machine (Windows Vista x86), with the following browsers installed:
- Internet Explorer 9
- Safari

under Tools -> Options -> General -> Web Browser, the drop-down list shows:
- <Default System Browser>
- Internet Explorer
- Chrome
- Embedded WebKit Browser

* With the Chrome option set, Window -> Web -> Web Browser doesn't open anything, no warning balloon appears, and a "Opening Browser ..." string appears in the left of the status bar for a few seconds.

* Chrome is listed but not installed.

* Safari is installed but not listed (but who cares now, Safari for Windows has been discontinued).
Comment 27 Tomas Mysik 2014-01-20 07:13:28 UTC
(In reply to unai from comment #26)
> where does NB actually look for the Default System Browser
> info?).

xdg-settings get default-web-browser
(fallback is to run /usr/bin/x-www-browser)