gnome-open uses firefox while it's not the preferred browser

Bug #670128 reported by Ian Corne
170
This bug affects 29 people
Affects Status Importance Assigned to Milestone
Chromium Browser
Unknown
Unknown
chromium-browser (Ubuntu)
Fix Released
Medium
Chris Coulson
Natty
Fix Released
Medium
Chris Coulson
gnome-control-center (Ubuntu)
Fix Released
Medium
Michael Terry
Natty
Fix Released
Medium
Michael Terry
xdg-utils (Fedora)
Fix Released
Medium
xdg-utils (Ubuntu)
Fix Released
Medium
Chris Coulson
Natty
Fix Released
Medium
Chris Coulson

Bug Description

Chromium is set as prefered browser, but firefox opens.

$ gconftool --get /desktop/gnome/url-handlers/http/command
/usr/bin/chromium-browser %s

[Workaround]
Run:
  xdg-mime default chromium-browser.desktop x-scheme-handler/http
  xdg-mime default chromium-browser.desktop x-scheme-handler/https

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: libgnome2-0 2.32.0-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.36-1.7-generic-pae 2.6.36
Uname: Linux 2.6.36-1-generic-pae i686
Architecture: i386
Date: Tue Nov 2 22:13:37 2010
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: libgnome

Revision history for this message
Ian Corne (icorne) wrote :
Anders Kaseorg (andersk)
Changed in libgnome (Ubuntu):
status: New → Confirmed
Revision history for this message
In , Bastien (bastien-redhat-bugs) wrote :

Created attachment 461347
patch

GNOME switched to using the x-scheme-handler/http(s) for the default browser, instead of a custom GConf setting.

See also:
http://www.hadess.net/2010/10/new-control-center-and-you.html
http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html#id2869854

Revision history for this message
In , Bastien (bastien-redhat-bugs) wrote :

Note that this is needed for Chromium to detect whether it's the default browser or not.

Revision history for this message
In , Colin (colin-redhat-bugs) wrote :

In order to upstream this patch, wouldn't we need to make it able to detect GNOME 2.32 vs 3 and choose the right one?

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

Any sh snippet advice on how to detect gnome3? (and is this change specific to gnome3)?

Anders Kaseorg (andersk)
summary: - gnome-opens uses firefox while it's not the prefered browser.
+ gnome-open uses firefox while it's not the preferred browser
Revision history for this message
In , Bastien (bastien-redhat-bugs) wrote :

(In reply to comment #3)
> Any sh snippet advice on how to detect gnome3? (and is this change specific to
> gnome3)?

It's GNOME3 specific, so this is what we'll need in Fedora going forward (from F15 onwards).

Revision history for this message
In , Bastien (bastien-redhat-bugs) wrote :

Created attachment 461430
updated patch

Fixes xdg-settings check not working as expected (we were comparing a desktop name to a binary one).

Revision history for this message
In , Bastien (bastien-redhat-bugs) wrote :

(In reply to comment #2)
> In order to upstream this patch, wouldn't we need to make it able to detect
> GNOME 2.32 vs 3 and choose the right one?

Right, it seems that the upstream isn't as dead as I thought and Rex is a committer, so I should fix it up.

Revision history for this message
In , Bastien (bastien-redhat-bugs) wrote :

Created attachment 461442
new patch

Adds the ability to detect GNOME 3.x, on its own, and also ports the mailto functionality to x-scheme-handler.

I also tested the GNOME3 code path more thoroughly for the browser settings, and it works as expected on the command-line, and when used in chromium ("check" to detect the current browser, and "set" to set chromium as the default browser).

Evan Broder (broder)
Changed in libgnome (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Anders Kaseorg (andersk) wrote :

Hmm. I think this is related to

firefox (4.0~b7+nobinonly-0ubuntu1) natty; urgency=low
  …
  * Add x-scheme-handler magic to desktop files
    - update debian/firefox.desktop.in
    - update debian/firefox-beta.desktop.in
    - update debian/firefox-nightly.desktop.in
    - update debian/firefox-unofficial.desktop.in
  …
 -- Chris Coulson <email address hidden> Wed, 17 Nov 2010 21:35:57 +0000

which causes these warnings when running ‘update-desktop-database’:

$ sudo update-desktop-database
Warning in file "/usr/share/applications/firefox.desktop": usage of MIME type "x-scheme-handler/http" is discouraged (the use of "x-scheme-handler" as media type is strongly discouraged in favor of a subtype of the "application" media type)
Warning in file "/usr/share/applications/firefox.desktop": usage of MIME type "x-scheme-handler/https" is discouraged (the use of "x-scheme-handler" as media type is strongly discouraged in favor of a subtype of the "application" media type)
Warning in file "/usr/share/applications/firefox.desktop": usage of MIME type "x-scheme-handler/ftp" is discouraged (the use of "x-scheme-handler" as media type is strongly discouraged in favor of a subtype of the "application" media type)
Warning in file "/usr/share/applications/firefox.desktop": usage of MIME type "x-scheme-handler/chrome" is discouraged (the use of "x-scheme-handler" as media type is strongly discouraged in favor of a subtype of the "application" media type)

If I remove the x-scheme-handler types from /usr/share/applications/firefox.desktop and rerun ‘update-desktop-database’, the problem goes away, and gnome-open lets me use my preferred web browser again.

affects: libgnome (Ubuntu) → firefox (Ubuntu)
Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue is rather that chromium and other need similar updates

Revision history for this message
Sebastien Bacher (seb128) wrote :
affects: firefox (Ubuntu) → chromium (Ubuntu)
affects: chromium (Ubuntu) → chromium-browser (Ubuntu)
Revision history for this message
Anders Kaseorg (andersk) wrote :

I now have chromium-browserchromium-browser 9.0.587.0~r66374-0ubuntu1~ucd~dev2 from ppa:chromium-daily-dev, which has already been updated to include
  MimeType=text/html;text/xml;application/xhtml_xml;x-scheme-handler/http;x-scheme-handler/https;
in /usr/share/applications/chromium-browser.desktop. However, this isn’t sufficient to cause Chromium to act as the default browser, either when I select it in gnome-default-applications, or when I tell Chromium to make itself the default browser in its Preferences page.

It finally worked after I manually ran
  xdg-mime default chromium-browser.desktop x-scheme-handler/http
  xdg-mime default chromium-browser.desktop x-scheme-handler/https

gnome-default-applications-properties needs to be updated to set the default associations for these new types, and xdg-settings needs to be updated so that chromium can set them for itself.

Revision history for this message
Bastien Nocera (hadess-deactivatedaccount) wrote :

Downgrade to a glib2 that's not targetted for GNOME 3, or upgrade the control-center to GNOME 3. It's a packaging bug, with mismatching versions.

Evan Broder (broder)
Changed in gnome-control-center (Ubuntu):
importance: Undecided → Medium
Changed in xdg-utils (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Alex Mayorga (alex-mayorga) wrote :

These Mozilla Minefield crashes might be related:
Firefox-4.0 4.0b9pre Crash Report [@ nsGNOMEShellService::SetDefaultBrowser ] http://crash-stats.mozilla.com/report/index/0cad1e34-8713-48d0-b123-2f3372110103

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I get the same on the latest Chromium from ppa:chromium-daily/ppa:

Warning in file "/usr/share/applications/chromium-browser.desktop": usage of MIME type "x-scheme-handler/http" is discouraged (the use of "x-scheme-handler" as media type is strongly discouraged in favor of a subtype of the "application" media type)
Warning in file "/usr/share/applications/chromium-browser.desktop": usage of MIME type "x-scheme-handler/https" is discouraged (the use of "x-scheme-handler" as media type is strongly discouraged in favor of a subtype of the "application" media type)

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Alex - yes, quite possibly. I will investigate that and address as part of https://bugzilla.mozilla.org/show_bug.cgi?id=611953 if it's related

Changed in gnome-control-center (Ubuntu):
assignee: nobody → Michael Terry (mterry)
Revision history for this message
Sebastien Bacher (seb128) wrote :

gnome-control-center (1:2.32.1-0ubuntu3) natty; urgency=low

  * 140_backport_default_internet_apps.patch:
    - Backport default Internet app panel from 3.0 to 2.32. This lets one
      set the new-style glib url handlers for web and mail.
  * 141_set_default_internet_apps.patch:
    - On startup, set the web and mail combo boxes to the current glib
      value. Patch sent upstream.
  * 142_fix_icons_for_default_apps.patch:
    - Fix icon handling for web and mail combo boxes. Patch sent upstream.
  * 143_write_default_internet_apps_to_gconf.patch:
    - Until we update GNOME to 3.0, write back the current glib url
      handlers to gconf for apps still directly using such keys rather than
      the glib functions for launching apps.

Changed in gnome-control-center (Ubuntu):
status: New → Fix Released
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I think a solution for Chromium will be to use "new" mimes only on Natty, and revert to the old ones on Lucid/Maverick.
(It does not affect the current 8.0.552 branch, but it will affect 9.0.593+ branch when it'll be released. Also, it affects beta/dev/nightly ppas).

Revision history for this message
In , Bastien (bastien-redhat-bugs) wrote :

Any news on this?

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

Thanks for the poke, I'll work on this today.

Revision history for this message
In , Rex (rex-redhat-bugs) wrote :

Patch upstreamed (with some minor fuzz),

http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=6f49c05ceb2a1935d07c49c2e100b5cf3cdf5f26

and snapshot build xdg-utils-1.1.0-0.2.20110201.fc15 submitted,
http://koji.fedoraproject.org/koji/taskinfo?taskID=2754753

Revision history for this message
Sebastien Bacher (seb128) wrote :

seems the issue has been fixed upstream in http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=6f49c05ceb2a1935d07c49c2e100b5cf3cdf5f26 if someone wants to work on backporting that to natty

Changed in xdg-utils (Ubuntu):
status: New → Triaged
Revision history for this message
Sebastien Bacher (seb128) wrote :

not that the GNOME3 detection code will need to be updated since the libraries changed in natty but GNOME is still 2.32 so checking for the binary the way it's done upstream will not work on natty

Revision history for this message
Dmitry Shachnev (mitya57) wrote : Re: [Bug 670128] Re: gnome-open uses firefox while it's not the preferred browser

Do you plan to include Gnome Control Centre 3 (when it is released) in Natty?

Revision history for this message
Sebastien Bacher (seb128) wrote :

no, GNOME3 is released some weeks before natty

Bryce Harrington (bryce)
description: updated
Changed in xdg-utils (Ubuntu):
assignee: nobody → Chris Coulson (chrisccoulson)
status: Triaged → In Progress
milestone: none → ubuntu-11.04-beta-2
Changed in chromium-browser (Ubuntu Natty):
status: Confirmed → Triaged
assignee: nobody → Chris Coulson (chrisccoulson)
milestone: none → ubuntu-11.04-beta-2
Changed in xdg-utils (Ubuntu Natty):
status: In Progress → Triaged
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I can't upload xdg-utils, so I'll just attach the diff here.

This is just a backport of the relevant parts of http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=6f49c05ceb2a1935d07c49c2e100b5cf3cdf5f26 to make the default browser/mail settings use the x-scheme-handler mimetypes.

In addition to this though, I had to also fix xdg-mime to use the users correct default mimetype handler settings (it was using ~/.local/share/applications/defaults.list, which is wrong. It'e meant to be ~/.local/share/applications/mimeapps.list, according to http://www.freedesktop.org/wiki/Specifications/mime-actions-spec and this is what everything else already uses)

Chromium is shipping its own xdg-mime and xdg-settings, so I've assigned myself to that too

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdg-utils - 1.1.0~rc1-2ubuntu2

---------------
xdg-utils (1.1.0~rc1-2ubuntu2) natty; urgency=low

  * Fix LP: #670128 - gnome-open uses firefox while it's not the preferred
    browser. Backport upstream changes to use the x-scheme-handler types
    for checking/setting the default browser/mail client in xdg-settings
    and xdg-email. In addition to this, we fix xdg-mime to get/set
    default mimetype handlers using the users mimeapps.list, rather than
    the defaults.list, which doesn't work anywhere
    - add debian/patches/gnome-3.0.diff
    - update debian/patches/series
 -- Chris Coulson <email address hidden> Fri, 08 Apr 2011 02:00:05 +0100

Changed in xdg-utils (Ubuntu Natty):
status: Triaged → Fix Released
Changed in chromium-browser (Ubuntu Natty):
status: Triaged → Invalid
Revision history for this message
Anders Kaseorg (andersk) wrote :

This bug is still present in chromium-browser. (To be sure, I tested again with chromium-browser 10.0.648.204~r79063-0ubuntu2 and xdg-utils 1.1.0~rc1-2ubuntu2.)

See Chris’s comment #16: “Chromium is shipping its own xdg-mime and xdg-settings, so I've assigned myself to that too”.

Changed in chromium-browser (Ubuntu Natty):
status: Invalid → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

doesn't seem sponsoring is required there so unsubscribing the sponsors but feel free to add them back if that's wrong

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package chromium-browser - 10.0.648.205~r81283-0ubuntu1

---------------
chromium-browser (10.0.648.205~r81283-0ubuntu1) natty; urgency=high

  * New upstream minor release from the Stable Channel (LP: #762275)
    This release fixes the following security issues:
    - [75629] Critical, CVE-2011-1301: Use-after-free in the GPU process.
      Credit to Google Chrome Security Team (Inferno).
    - [78524] Critical, CVE-2011-1302: Heap overflow in the GPU process. Credit
      to Christoph Diehl.
  * Make the default mail client and browser settings work with the
    x-scheme-handler method of registering URI handlers in gnome3.
    This is based on the xdg-utils 1.1.0~rc1-2ubuntu3 fix by Chris Coulson
    <email address hidden>, itself based on Bastien Nocera <email address hidden>
    upstream fix (LP: #670128)
    - add debian/patches/xdg-utils_gnome3_lp670128_for_natty.patch
    - update debian/patches/series
  * Fix the apport hooks to pass the expected 'ui' to add_info(), needed when
    called from apport/ubuntu-bug (LP: #759635)
    - update debian/apport/chromium-browser.py
  * Report a dedicated WMClass per webapp, needed by Unity/bamf.
    (backported from trunk) (LP: #692462)
    - add debian/patches/webapps-wm-class-lp692462.patch
    - update debian/patches/series
 -- Fabien Tassin <email address hidden> Thu, 14 Apr 2011 22:36:16 +0200

Changed in chromium-browser (Ubuntu Natty):
status: Confirmed → Fix Released
Revision history for this message
Otus (jan-varho) wrote :

This is *not* fixed in chromium 10.0.648.205~r81283-0ubuntu1 for me. The browser asks to set default at each launch, but doesn't actually set even if I give it permission.

Revision history for this message
James Cuzella (trinitronx) wrote :

This bug does *not* seem fixed for me. I'm running:

google-chrome-stable - 11.0.696.68-r84545
xdg-utils - 1.1.0~rc1-2ubuntu3
Ubuntu 11.04 "natty"

Setting via chrome's internal "Make Google Chrome my default browser" button does *not* work.
Setting via "sudo update-alternatives --config x-www-browser" does *not* work.
Setting via 'System'->'Preferences'->'Preferred Applications' does *not* work.

Revision history for this message
Micah Gersten (micahg) wrote :

If it's just about setting the default browser, that's being tracked in bug 776393. This bug was for opening links in chromium/chrome once it already is set as the default.

Revision history for this message
In , Mark (mark-redhat-bugs) wrote :

Not sure if this needs to be re-opened or if it's a new issue, but the functionality is broken in xdg-utils-1.1.0-0.6.20110505.fc15.noarch.

[mark@thinkpad ~]$ xdg-settings get default-web-browserwhich: no gnome-default-applications-properties in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/mark/bin)
which: no gnome-default-applications-properties in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/mark/bin)
google-chrome.desktop
[mark@thinkpad ~]$ /opt/google/chrome/xdg-settings get default-web-browser
which: no gnome-default-applications-properties in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/mark/bin)
google-chrome.desktop

Chrome will use the system supplied one if available, and it keeps asking me if it can be the default. I've tried both stable (Chrome 12) and unstable (Chrome 14) and both fail.

As an aside, why is which(1) stderr output redirected to stdout?

Revision history for this message
In , Mark (mark-redhat-bugs) wrote :

I think the Chromium guys figured it out. Please pick up the change from here: http://code.google.com/p/chromium/issues/detail?id=89258#c4

Revision history for this message
In , Mark (mark-redhat-bugs) wrote :
Changed in xdg-utils (Fedora):
importance: Unknown → Medium
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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