Thunderbird > 4.x on Linux does not honour default browser

3

2

Under KDE 4.7 I have "chromium-browser-chromium" set as my default browser in system settings.

This works for KDE apps, but not Thunderbird. I suspect that Thunderbird is looking for the default browser in a GTK type config place, rather than a KDE setting.

So while KDE apps open links in Chromium, Thunderbird (I am currently in tb6.0, but the same behaviour happens in previous versions) opens links in Firefox.

I know I can force the issue in prefs.js but I would like to get thunderbird to respect the system setting. How can I do this?

Paul

Posted 2011-08-23T22:27:17.017

Reputation: 52 173

Answers

5

Thunderbird (at least version 6 here) appears to be using the XDG MIME actions specification. The preferences are stored in ~/.local/share/applications/mimeapps.list, and all desktop environments are supposed to respect them.

[Default Applications]
text/html=chromium.desktop
x-scheme-handler/http=chromium.desktop

Older versions of Thunderbird may still be using GNOME's Gvfs for this. You can check using gconftool-2:

$ gconftool-2 --get /desktop/gnome/url-handlers/http/command
firefox %s

If that's the case, the best option is to configure Gvfs to use xdg-open for all URL schemes, which in turn should invoke the right program from mimeapps.list:

$ for scheme in http https about unknown; do
    gconftool-2 --set /desktop/gnome/url-handlers/$scheme/command \
        --type string "xdg-open %s"
done

Or you could try xdg-settings, which... honestly, I'm not sure what it does:

$ xdg-settings set default-web-browser chromium.desktop

user1686

Posted 2011-08-23T22:27:17.017

Reputation: 283 655

Ah ok, this is tb6 so going by option 1, I have text/html=chromium-browser-chromium.desktop;userapp-Firefox-JWXOSV.desktop;. This suggests firefox is a fallback to chromium. The chromium desktop file definitely exists in /usr/share/applications/ and has the correct chromium-browser %u exec line. I'll try removing the fallback but strange tb is not respecting the primary option. – Paul – 2011-08-24T10:20:38.760

@Paul: text/html is only for HTML files. When opening http URLs, x-scheme-handler/http is used. – user1686 – 2011-08-24T12:22:48.350

Interesting. I don't have that handler defined in .local. However, in /usr/share/applications/mimeinfo.cache I have x-scheme-handler/http=opera-browser.desktop;firefox.desktop;chromium-browser-chromium.desktop; Which suggests opera should be first. I get that KDE should honour the .local copy, but does it write to it? – Paul – 2011-08-24T14:17:45.050

I had to add x-scheme-handler/https as well. Otherwise, Thunderbird opens HTTP links with my preferred browser and HTTPS links with the default browser (for some definition of default). – cayhorstmann – 2012-10-20T14:50:10.533

0

Here's one thing that works for me: http://community.linuxmint.com/tutorial/view/1391

Basically, the idea is to set network.protocol-handler.warn-external.http to true. Same applies to network.protocol-handler.warn-external.https for https protocol and maybe network.protocol-handler.warn-external.ftp for FTP. After applying that, Thunderbird will ask you which program to open the URL with and allow you to remember the choice.

d33tah

Posted 2011-08-23T22:27:17.017

Reputation: 1 014