Modify

Opened 13 years ago

Closed 9 years ago

Last modified 9 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 Changed 13 years ago by richlv

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 Changed 13 years ago by jburgess777@…

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 Changed 13 years ago by anonymous

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 Changed 13 years ago by richlv

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 Changed 13 years ago by bastiK

Resolution: fixed
Status: newclosed

comment:6 Changed 12 years ago by richlv

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 Changed 12 years ago by bastiK

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

comment:8 Changed 12 years ago by richlv

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 Changed 12 years ago by richlv

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 Changed 12 years ago by bastiK

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

comment:11 in reply to:  10 Changed 12 years ago by Fabi2

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 Changed 12 years ago by richlv

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 Changed 12 years ago by bastiK

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

comment:14 Changed 10 years ago by anonymous

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 Changed 10 years ago by Fabi2

Description: modified (diff)

For the record: i used gnome-vfs.

comment:16 Changed 10 years ago by Don-vip

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

comment:17 Changed 10 years ago by Don-vip

Cc: Dakon added

comment:18 Changed 9 years ago by stoecker

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

comment:19 Changed 9 years ago by stoecker

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

comment:20 Changed 9 years ago by stoecker

Cc: RicoZ added

comment:21 Changed 9 years ago by 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.

comment:22 in reply to:  21 Changed 9 years ago by skyper

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 Changed 9 years ago by simon04

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 Changed 9 years ago by Don-vip

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.