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 221803 - <Default System Browser> not recognizing my default system browser
Summary: <Default System Browser> not recognizing my default system browser
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Extbrowser (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 216412 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-09 11:18 UTC by Antonin Nebuzelsky
Modified: 2013-07-23 07:14 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2012-11-09 11:18:09 UTC
Product Version: NetBeans IDE 7.3 Beta 2 (Build 201211062253)
Updates: NetBeans IDE is updated to version , NetBeans 7.3 Beta 2
Java: 1.7.0_09; Java HotSpot(TM) 64-Bit Server VM 23.5-b02
Runtime: Java(TM) SE Runtime Environment 1.7.0_09-b05
System: Linux version 3.5.0-18-generic running on amd64; UTF-8; en_US (nb)
Ubuntu 12.10, Gnome 3, Gnome Shell

The setting of Options / General / Web Browser is <Default System Browser>. My system's browser is set to Chromium.

However, clicking any hyperlink in NetBeans opens the page in Firefox.
Comment 1 Petr Jiricka 2012-12-06 17:59:17 UTC
David, since you are on Ubuntu and also use Chromium, can you reproduce this?
Comment 2 David Konecny 2012-12-07 04:38:19 UTC
I can reproduce it. extbrowser module is using x-www-browser to start the default browser. So the explanation is that chromium is not set as a default browser for x-www-browser. Using "sudo update-alternatives --config x-www-browser" to set Chromium as a default one resolves this issue. I do not know anything about background though - why are we using x-www-browser and why it does not get updated automatically when I set default browser via "Default Applications" in Ubuntu's "All Settings". WORKSFORME?
Comment 3 Petr Jiricka 2012-12-07 10:59:32 UTC
> I do not know anything about background 

I do not know either - Denis, do you know? And is there another way to detect the default browser on Ubuntu than x-www-browser?

Requiring users to do "sudo update-alternatives --config x-www-browser" does not sound like an acceptable resolution - could we do a better job at detecting the default browser?
Comment 4 Tomas Mysik 2013-07-17 07:39:28 UTC
Taking over, I will try to look at it.

What I plan to do:
- "x-www-browser" is wrong - it works only on Debian (and its derivates), moreover it is a _system_ preferred browser, not a user preferred browser (user can prefer different browser than system administrator, of course);
- the proper way should be using XDG, it should work on all distros (at least I hope so).
Comment 5 Tomas Mysik 2013-07-17 07:40:26 UTC
(In reply to comment #0)
> The setting of Options / General / Web Browser is <Default System Browser>. My
> system's browser is set to Chromium.

Tondo, what you get if you run the following command, please?

xdg-settings get default-web-browser

Thanks.
Comment 6 Tomas Mysik 2013-07-17 11:17:10 UTC
Should be fixed I hope, please verify. Thanks.

http://hg.netbeans.org/web-main/rev/605e2b8f23b0
Comment 7 Tomas Mysik 2013-07-17 11:40:56 UTC
BTW I just noticed why x-www-browser was preferred - see issue #146603. However, I prefer the current fix which is IMHO correct.

If anyone (perhaps David as the reporter of issue #146603 ;) feels that URLs from JAR files should be handled, please reopen and I will add a check for the URL (open URLs from JAR using x-www-browser; use xdg-open for the rest).

Thanks.
Comment 8 Tomas Mysik 2013-07-17 11:55:12 UTC
(In reply to comment #7)
> (open URLs from JAR using x-www-browser; use xdg-open for the rest).

It would be better to use directly ChromeBrowser class etc. but not sure if it is doable (the code is a bit complicated).

Thanks.
Comment 9 Tomas Mysik 2013-07-17 12:22:01 UTC
(In reply to comment #7)
> BTW I just noticed why x-www-browser was preferred - see issue #146603.

After discussion with Petr, it seems that it should work with JAR URLs even with my fix. In any case, I will test it tomorrow and reopen if not.

Thanks.
Comment 10 Quality Engineering 2013-07-18 02:37:31 UTC
Integrated into 'main-silver', will be available in build *201307172300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/605e2b8f23b0
User: Tomas Mysik <tmysik@netbeans.org>
Log: #221803 - <Default System Browser> not recognizing my default system browser
Comment 11 Tomas Mysik 2013-07-18 09:17:10 UTC
*** Bug 216412 has been marked as a duplicate of this bug. ***
Comment 12 Antonin Nebuzelsky 2013-07-19 10:45:25 UTC
(In reply to comment #5)
> Tondo, what you get if you run the following command, please?
> 
> xdg-settings get default-web-browser

tonda@tonda-latitude:~$ xdg-settings get default-web-browser
chromium-browser.desktop

Will it work also with other window managers?

Thanks.
Comment 13 Tomas Mysik 2013-07-19 10:50:51 UTC
(In reply to comment #12)
> Will it work also with other window managers?

XDG is window manager independent, AFAIK all (common) distros support it.

Thanks.
Comment 14 David Konecny 2013-07-22 21:19:21 UTC
(In reply to comment #7)
> If anyone (perhaps David as the reporter of issue #146603 ;) feels that URLs
> from JAR files should be handled

Detecting system browser correctly is more important than opening jar:// URLs.
Comment 15 Tomas Mysik 2013-07-23 07:14:30 UTC
(In reply to comment #14)
> Detecting system browser correctly is more important than opening jar:// URLs.

I was too fast, sorry. It works correctly for URLs from JAR/ZIP files.

Thanks.