sensible-browser should use xdg-open for Gnome / KDE / XFCE support

Bug #204858 reported by mlaverdiere
56
This bug affects 9 people
Affects Status Importance Assigned to Milestone
debianutils (Debian)
New
Unknown
kdebase (Ubuntu)
Invalid
Low
Unassigned
sensible-utils (Ubuntu)
Invalid
High
Unassigned

Bug Description

Hi,

I'm on Kubuntu 7.10 and I observe that the default Web browser for OpenOffice.org (i.e. the one that opens whenever you click on an hyperlink within OOoWriter, OOoCalc, etc.) is... w3m! Obviously, the browser should be Firefox for Ubuntu/Xubuntu and Konqueror for Kubuntu.

To change the default browser for Openoffice.org (and maybe other apps/ressources), the solution is quite simple, You just have to type:

sudo update-alternatives --config x-www-browser

and choose the right browser for you.

Thanks.

Revision history for this message
BrandonTomlinson (druke) wrote :

I'm getting firefox in ubuntu hardy beta

Revision history for this message
John Vivirito (gnomefreak) wrote :

This is a setting rather than a bug. Please run the command above or in Gnome go to System > Preferences > Preferred Applications and set default browser. For this to be done from install it would have to be configured in OO.o its not likely that is will change in OO.o as people dont always use the default browser that is installed with Ubuntu/Kubuntu. We have these settings for that reason so people can customize thier Desktop as they wish.

Changed in firefox:
status: New → Invalid
Revision history for this message
John Vivirito (gnomefreak) wrote :

And in Hardy default is Firefox here as well but this is done outside of OO.o or Firefox its done in Gnome

Revision history for this message
Harald Sitter (apachelogger) wrote :

Really openoffice.org should use XDG and intregrate with the desktop setup rather than setting stupid assumed defaults.

Revision history for this message
Chris Cheney (ccheney) wrote :

Already uses firefox here.

Changed in openoffice.org:
status: New → Invalid
Revision history for this message
Adrien Cordonnier (adrien-cordonnier) wrote :

This bug also affects Kubuntu 8.10 (Intrepid) with two problems:

1) x-www-browser is not equivalent to System > Preferences > Preferred Applications > set default browser
2) with Kubuntu Intrepid, "sudo update-alternatives --config x-www-browser" does not offer the choice for Konqueror!

This bug should be affected to the package which set or compute "x-www-browser". It may also be affected to the Kubuntu preferred application config package. The expected behaviour is:

x-www-browser should follow the preferred application setting which depends on the active desktop, e.g. Firefox for Ubuntu, Konqueror for Kubuntu.

Revision history for this message
Chris Cheney (ccheney) wrote :

Adrien,

The bugs you mentioned with respect to konqueror would be bugs in the konqueror packaging itself as far as I can tell.

Reassigning to kdebase.

Thanks,

Chris

Changed in firefox:
importance: Undecided → Medium
status: Invalid → New
Changed in kdebase (Ubuntu):
importance: Medium → Low
status: New → Confirmed
summary: - Openoffice.org default Web browser should be Firefox or Konqueror
+ Konqueror does not appear as a choice in update-alternatives
Changed in kdebase (Ubuntu):
status: Confirmed → Invalid
summary: - Konqueror does not appear as a choice in update-alternatives
+ Openoffice.org needs to follow XDG to determine default browser
Revision history for this message
Harald Sitter (apachelogger) wrote : Re: Openoffice.org needs to follow XDG to determine default browser

Konqueror issue is tracked in bug report 353678 and probably will be taken care of before 9.04 gets out.

Revision history for this message
Harald Sitter (apachelogger) wrote :

The real issue here is that OpenOffice.org doesn't use xdg-open or have an own implementation of it, which is awkward at best.
If I use KDE i expect OOo to use the blue-headed Konqueror, or whatever browser I configured in KDE's control center, not some weird browser as defined in some weird system for which there is not even a sensible GUI pre-intalled.

Changed in openoffice.org (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Chris Cheney (ccheney) wrote :

No the real problem appears to be that the Debian/Ubuntu standard 'sensible-browser', which is what OOo actually uses, does not use xdg-open.

===

if test -n "$DISPLAY"; then
    if test -n "$GNOME_DESKTOP_SESSION_ID"; then
        if test -x /usr/bin/gnome-www-browser; then
            exec /usr/bin/gnome-www-browser "$URL"
        elif test -x /usr/bin/x-www-browser; then
            exec /usr/bin/x-www-browser "$URL"
        elif test -x /usr/bin/gnome-terminal && test -x /usr/bin/www-browser; then
            exec /usr/bin/gnome-terminal -e "/usr/bin/www-browser \"$URL\""
        fi
    fi
    if test -x /usr/bin/x-www-browser; then
        exec /usr/bin/x-www-browser "$URL"
    elif test -x /usr/bin/x-terminal-emulator && test -x /usr/bin/www-browser; then
        exec /usr/bin/x-terminal-emulator -e /usr/bin/www-browser "$URL"
    fi
elif test -x /usr/bin/www-browser; then
    exec /usr/bin/www-browser "$URL"
fi

affects: openoffice.org (Ubuntu) → debianutils (Ubuntu)
Changed in debianutils (Ubuntu):
importance: Undecided → High
status: Confirmed → New
summary: - Openoffice.org needs to follow XDG to determine default browser
+ sensible-browser should also use xdg-open for KDE support
Revision history for this message
Chris Cheney (ccheney) wrote : Re: sensible-browser should also use xdg-open for KDE support

Well there is also the konqueror bug 353678. But even still then Xubuntu wouldn't work correctly, ad nauseam. So this still needs to be fixed in sensible-browser as well. Note that in the new Debian version of this package it is split out into sensible-utils.

Revision history for this message
Chris Cheney (ccheney) wrote :

The patch for this probably needs to either also patch xdg-open to not have a fallback case or use the code that xdg-open uses to detect Gnome/KDE/XFCE.

Then do something like

if test -n "$DISPLAY"; then
  if test -n "$GNOME_DESKTOP_SESSION_ID"; then
    xdg-open "$URL"
  elif test -n KDEtest; then
    xdg-open "$URL"
 elif test -n XFCEtest; then
   xdg-open "$URL"
  endif
    if test -x /usr/bin/x-www-browser; then
        exec /usr/bin/x-www-browser "$URL"
    elif test -x /usr/bin/x-terminal-emulator && test -x /usr/bin/www-browser; then
        exec /usr/bin/x-terminal-emulator -e /usr/bin/www-browser "$URL"
    fi
elif test -x /usr/bin/www-browser; then
    exec /usr/bin/www-browser "$URL"
fi

summary: - sensible-browser should also use xdg-open for KDE support
+ sensible-browser should also use xdg-open for KDE / XFCE support
summary: - sensible-browser should also use xdg-open for KDE / XFCE support
+ sensible-browser should use xdg-open for Gnome / KDE / XFCE support
Revision history for this message
Louis-Dominique Dubeau (ldd) wrote :

I've run into this bug today.

I've read sensible-browser's code before reading this bug report and came to the same conclusion as Chris.

sensible-browser is currently broken because if it detects a Gnome desktop, it directly invokes gnome-www-browser but doing this actually *bypasses* what the user configures in "System > Preferences > Preferred Applications".

Bypassing the user's preferences is NOT sensible.

Chris Cheney (ccheney)
Changed in debianutils (Ubuntu):
milestone: none → ubuntu-9.10-beta
Revision history for this message
Michael Terry (mterry) wrote :

This is tricky. sensible-browser is called by xdg-open in the fallback case. So if we add smarts to sensible-browser to call xdg-open for some desktops, then we risk the fallbacks not matching up perfectly and an infinite loop.

It seems like xdg-open is the smartest/most-toplevel of the scripts that open URLs. So how about either of these options?

A) Switch OO.o to use xdg-open

B) Copy the logic in sensible-browser to the generic fallback case of xdg-open (instead of calling sensible-browser) and then make sensible-browser just be a call to xdg-open. You'd also have to deal with the fact that sensible-browser should work without a URL, but xdg-open does not.

(A) seems less intrusive; (B) seems more widely useful but much less likely to be accepted. Chris, you didn't like (A)?

Changed in debianutils (Debian):
status: Unknown → New
Colin Watson (cjwatson)
affects: debianutils (Ubuntu) → sensible-utils (Ubuntu)
Changed in sensible-utils (Ubuntu):
status: New → Confirmed
Revision history for this message
K. Deniz Ogut (kdenizogut) wrote :

Ubuntu Karmic Koala, here. My experience:
I installed Google Chrome to give a try.
Now, when I click GIMP help, it opens the page via Chrome. For sure my System > Preferences > Preferred Applications > set default browser way leads to Firefox but GIMP had its settings as <sensible-browser %s>. And the command <sensible-browser> opens Google's Chrome. Now that -from this report- I know about the situation but for many people its very weird to see lets say Chrome as if its some kind of "default browser of Ubuntu".
Regards...

Revision history for this message
K. Deniz Ogut (kdenizogut) wrote :

From IRC room for Lucid: Lucid user
a) with Chromium as default gets Google Chrome for sensible-browser
b) with Firefox as default gets Epiphany for sensible-browser

Revision history for this message
Thibault Lemaitre (thibault.lemaitre) wrote :

As mentioned in the Bug #562476, comment #5, see [1] for details :
"Yes, it's the same issue for sensible-browser too.

This is a long-standing issue, and it is well known that the alternatives system sucks for this type of thing. The alternatives system is not a user-configurable preference, but is a system-wide preference that can only be configured by the root user. In an ideal world, applications shouldn't be using x-www-browser and gnome-www-browser at all, as there are other ways to do this"

[1] : https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/562476/comments/5

Changed in sensible-utils (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.