Modify

Opened 15 years ago

Closed 11 years ago

Last modified 11 years ago

#5108 closed defect (fixed)

Web browser not opened / not configurable

Reported by: richlv Owned by: team
Priority: normal Milestone: 14.01
Component: Core Version: latest
Keywords: Cc: Dakon, RicoZ

Description (last modified by Fabi2)

both and 3208 and 3312 fail to open browser with jre 1.6.0_20 on opensuse. this happens both with urls from the initial news page and with ctrl+i/ctrl+h keys.

no error is printed in the console. changing browser url in java control panel does not help.

this might be something with local configuration, but i've tried all options i could think of, and a kind person in #java directd me to application developers :)

Attachments (0)

Change History (24)

comment:1 by richlv, 15 years ago

ok, turned out to be (partially) local setup.
on this machine, kde is used. according to http://gis.638310.n2.nabble.com/Change-default-browser-td4379858.html, josm anyway tries gnome-open first.

renaming gnome-open allows to open web pages just fine from josm.

so this request would be to use kfmclient is kde is used (of course, if that is possible to detect in java)

comment:2 by jburgess777@…, 15 years ago

I reported a similar problem with another application using gnome-open in Fedora (http://bugzilla.redhat.com/show_bug.cgi?id=544119). It turns out that gnome-open only supports http:// URLs if the gvfs package is installed, by default they only guarantee to handle file:// URLs.

I believe the desktop-agnostic way to open a URL is to call xdg-open from the FreeDesktop.org Portland project http://portland.freedesktop.org/wiki/. I have seen some other applications trying xdg-open, htmlview, gnome-open, exo-open, kfmclient etc in turn until they find one which works.

comment:3 by anonymous, 15 years ago

May I throw in another suggestion:

Desktop.getDesktop.browse(uri) http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse%28java.net.URI%29

It does require java 1.6, but otherwise seems to work quite well in abstracting desktop specific ways of accessing the default browser.

Not sure if it is applicable, but thought I'd mention it never-the-less.

comment:4 by richlv, 15 years ago

additional note - if gvfs is missing, gnome-open exit code is 1. if all else fails and gnome-open is called, non-zero exit code should result in next alternative being tried

comment:5 by bastiK, 14 years ago

Resolution: fixed
Status: newclosed

comment:6 by richlv, 14 years ago

Resolution: fixed
Status: closedreopened

could it be detailed in which solution was used ?
i'm currently quite confused as to what josm is doing to call a browser (at least previously moving gnome-open to gnome-open2 opened opera for me as expected, now it just always gets me firefox :) )

(sorry for reopening, afraid that the question might get missed otherwise)

comment:7 by bastiK, 14 years ago

I used the suggestion by anonymous. I have Opera as default browser on Ubuntu and it opens without problems.

comment:8 by richlv, 14 years ago

i have a terrible suspicion that this might be something gnome-centric. i tried all of the available options i could find (kde, java), but it always keeps on opening in firefox.

now, xdg-open does properly obey my default browser setting.

looks like Desktop.getDesktop.browse is not really properly implemented...

comment:9 by richlv, 14 years ago

according to one of the answers here http://stackoverflow.com/questions/879938/workaround-for-no-default-browser-on-linux : "It looks like Desktop.browse() ultimately calls XDesktopPeer.browse() on *ix. That method is implemented by calling gnome_url_show. That probably works fine in some cases, but xdg-open is the cross-platform solution"

so it looks like java solution is a bit of a "wtf-braindead", and should be avoided if anything but gnome is targeted...

comment:10 by bastiK, 14 years ago

Yes I only tested gnome and assumed it would work on windows and mac os. It seems we are still not done here.

in reply to:  10 comment:11 by Fabi2, 14 years ago

Replying to bastiK:

Yes I only tested gnome and assumed it would work on windows and mac os. It seems we are still not done here.

At least it works now under Linux. I have som gnome-core componets installed but use KDE on archlinux x86_64 and it works with firefox, where as before some weeks I clicked the link an nothing happend. Yes, xdg-open should be used, but I use sun-java (1.6.0_21) as default now.

comment:12 by richlv, 14 years ago

Fabi2, you could have renamed gnome-open to something else, or installed gnome-vfs - that should have made it working with latest stable as well. for me renaming gnome-open didn't break anything, but josm started opening pages in opera as expected ;)

comment:13 by bastiK, 14 years ago

Ticket #5629 has been marked as a duplicate of this ticket.

comment:14 by anonymous, 12 years ago

stupid trac. lost my comment again.
on opensuse 12.3 with openjdk-1.7.0.6 and kde i have opera set as the default browser, but it still opens firefox.

apparently, /usr/share/applications/defaults.list still points to firefox.desktop. changing two lines helps :

x-scheme-handler/http=opera-browser.desktop
x-scheme-handler/https=opera-browser.desktop

no josm restart needed

comment:15 by Fabi2, 12 years ago

Description: modified (diff)

For the record: i used gnome-vfs.

comment:16 by Don-vip, 12 years ago

Ticket #8598 has been marked as a duplicate of this ticket.

comment:17 by Don-vip, 12 years ago

Cc: Dakon added

comment:18 by stoecker, 11 years ago

Summary: web browser not opened with jre 1.6.0_20Web browser not opened / not configurable

comment:19 by stoecker, 11 years ago

Ticket #9531 has been marked as a duplicate of this ticket.

comment:20 by stoecker, 11 years ago

Cc: RicoZ added

comment:21 by RicoZ, 11 years ago

I am not sure if #9531 is a true duplicate - I am asking for an unspectacular JOSM-specific configuration option where I can set

"browser: firefox %s"

or something similar. I would use that even if gnome-open and kde-open would work perfectly.

in reply to:  21 comment:22 by skyper, 11 years ago

Replying to RicoZ:

I am not sure if #9531 is a true duplicate - I am asking for an unspectacular JOSM-specific configuration option where I can set

"browser: firefox %s"

or something similar. I would use that even if gnome-open and kde-open would work perfectly.

Well in #9531 you did ask for either respect $BROWSER-env or setting the browser manually. This ticket is about using the proper environment variable (xdg-open).

comment:23 by simon04, 11 years ago

Resolution: fixed
Status: reopenedclosed

In 6682/josm:

fix #5629 #5108 #9568 - Make Unix web browsers configurable via browser.unix property

Default is ["xdg-open", "#DESKTOP#", "$BROWSER", "gnome-open", "kfmclient openURL", "firefox"].

comment:24 by Don-vip, 11 years ago

Milestone: 14.01

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.