82

I want to be able to click links in Thunderbird emails and have them open in Chromium (package name chromium-browser). Instead, they open in Firefox.

I have tried the following:

  1. xfce preferred applications (Chromium is not listed, so I had to hunt down the executable) -- next time I run chromium, it complains that it is no longer the default browser.

  2. Telling Chromium to set itself as the default browser. Thunderbird opens links in Firefox.

  3. update-alternatives. It's already listed as an alternative at the same priority as Firefox. The "open web browser" app menu item opens Chromium. Thunderbird opens links in Firefox.

I have looked through the entire preferences gui in Thunderbird (but not the advanced config editor yet) and seen nothing that mentions what browser to open links in.

Please note that this is not Google Chrome.

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
ikmac
  • 1,403

15 Answers15

131

This is what I found working for me: You will need to access the "config editor" in Thunderbird itself.

Open Thunderbird. In 24.6.0, the menu can be accessed on the right hand side of the top menu bar (next to the search bar and is represented by three horizontal lines).

Click Edit > then click Preferences >, a new window will open. You will need to select the Advanced tab, at the bottom of that tab Open the Config Editor.

Then, search for both network.protocol-handler.warn-external.http and network.protocol-handler.warn-external.https.

These two are most likely to have a current value of false. Change the value to true (do this by simply right clicking on them) and the next time you try to open a link from some e-mail it'll ask you which browser to use. Chromium isn't likely to be shown in the list of choices, so use the navigate button. You can find Chromium at /usr/bin/chromium-browser.

If using google chrome as your browser of choice you may want to make it /usr/bin/google-chrome or /usr/bin/google-chrome-stable If Thunderbird doesn't ask you which browser to use when you click on a link after doing this, you can try deleting mimeTypes.rdf file in your profile folder to reset it. The profile folder is typically found as ~/.thunderbird/xxxxxxxx.default/

Original text by Htbaa

Serge Stroobandt
  • 5,719
  • 1
  • 54
  • 59
14

In Thunderbird 11.0.1, it is simple, yet not intuitive:

  1. Go to Preferences (Menu EditPreferences).

  2. Click on the Attachments tab.

  3. In the Content Type and Action section set HTTPS, HTTP, and FTP to Use google-chrome (or other desired browser).

That worked for me after trying numerous things in terminal that did not work.

gertvdijk
  • 69,427
smhb
  • 141
11

Edit -> Preferences -> Advanced -> General -> Config Editor...

Right click -> New -> String

Enter the preference name:

network.protocol-handler.app.http

Value:

/usr/bin/x-www-browser

Setting Default Browser

In the command line, type

sudo update-alternatives --config x-www-browser && sudo update-alternatives --config gnome-www-browser
AKSiS
  • 127
7

Solution for the newest Thunderbird version 68.10 and upwards

There is a file now called handlers.json in your ????????.default profile directory under ~/.thunderbird.

Edit or create this file with a text editor while Thunderbird is closed.

Setting "action": 2 and adding {"name":"xdg-open","path":"/usr/bin/xdg-open"} to the first position of the pertaining HTTP and/or HTTPS "handlers: []" list, will launch the default browser or program as specified by the desktop environment.

The handlers.json file should look then like this for the Vivaldi browser:

{"defaultHandlersVersion":{},"mimeTypes":{"text/plain":{"action":2,"handlers":[{"name":"gvim","path":"/home/bin/gvim"}],"extensions":["asc","txt","text","pot","brf","srt"]},"application/pdf":{"action":4,"ask":true,"extensions":["pdf"]}},"schemes":{"https":{"action":2,"handlers":[{"name":"vivaldi-stable","path":"/usr/bin/vivaldi-stable"}]},"http":{"action":2,"handlers":[{"name":"vivaldi-stable","path":"/usr/bin/vivaldi-stable"}]}}}

Preceding mimetypes are for text and PDF.

Solution for newer Thunderbird versions

enter image description here

Solution for older versions using find

1.Thunderbird → Edit → Preferences → Advanced → Config Editor…:

network.protocol-handler.warn-external.http = true
network.protocol-handler.warn-external.https = true

2.Close Thunderbird.

3.At the command line, type:

$ find ~/.thunderbird/ -name mimeTypes.rdf -delete

4.Reopen Thunderbird and click on an HTTP(S)-link. A Launch Application window will open. Click on Choose….

5.Use Ctrl+L to directly enter a /usr/bin/ path to your favourite browser executable, e.g.: /usr/bin/vivaldi-stable

6.Check Remember my choice for http(s) links.

7.Open link

Serge Stroobandt
  • 5,719
  • 1
  • 54
  • 59
1

Because none of the listed solutions worked for me, here a different, very drastic way of getting the application to open links in Thunderbird changed:

(E.g. if links currently are opened with Firefox)

sudo apt-get remove firefox-esr

--> open Thunderbird and click on some link --> you can choose a different browser now. Now we can re-install Firefox

sudo apt-get install firefox-esr
Alex
  • 395
1

Well, I have never used thunderbird but, this looks right -->

When you click on a web link in Thunderbird, it invokes the default web browser for the operating system. It is possible to change this behavior by changing the default browser. On Linux, another way (tried with TB1.5 under Suse and Debian) is to insert the following line in Thunderbird's prefs.js or user.js file (of course put in the correct path to your firefox):

user_pref("network.protocol-handler.app.http", "/usr/bin/firefox");

You can find where Chromium is by typing -->

which chromium

into the terminal.

Source -->

http://kb.mozillazine.org/Changing_the_web_browser_invoked_by_Thunderbird

1

I tried this solution and it worked:

1) In Settings Manager switch your favourite browser as default browser.

2) update-alternatives --config x-www-browser

3) Follow steps written here

0

I have never posted to any message board ever for over 10 years, but I thought I should share a solution here.

I only switched to linux (mint, cinnamon at first and now xfce) 1.5 years ago.

For that entire time, I have been on a never-ending quest to somehow force thunderbird to open web links in the browser of my choice and always in a new window, not a new tab.

Many times I have read about changing the settings of these to true:

network.protocol-handler.warn-external.http = true network.protocol-handler.warn-external.https = true

This never did anything for me, until today, when I finally tried something new. I have tried many, many times to edit my handlers.json file in my thunderbird user dir, and I was able to change the default browser for web links (my choice was chromium-browser), but I could never get it to accept the --new-window switch.

TWO DISCOVERIES:

  1. If you rename the handlers.json, thunderbird WILL ask you what program to use to open your web link with, as the two above settings tell it to, because thunderbird makes a new handlers.json file and creates its contents from scratch.

  2. If you create a bash script file (that you make sure to make executable) with these two lines as its contents:

!/bin/bash

chromium-browser --new-window "$@"

and tell thunderbird to open web links with this script file, this works beautifully.

Sorry for the brute amateur posting and information, but this problem has haunted me for EVER, and I imagine that someone else out there might appreciate knowing about these two discoveries.

:-)

0

I was attempting to do the same with Chrome and none of the answers worked for me.

What did work was running this single command from a terminal:

xdg-settings set default-web-browser google-chrome.desktop

Note that it did not work without the .desktop extension. I have no idea why and I do not have a google-chrome.desktop file in my home folder (which was the current directory while running the above command) or anywhere in my path. It probably does exist somewhere.

This setting has persisted across reboot.

Note that Chrome was already my default browser, in that Chrome itself said it was the default browser, and every other application except from thunderbird was opening links in Chrome. However I did find out that xdg-open was opening urls in Firefox, and indeed the output of xdg-settings get default-web-browser was firefox (I had never set that and I had never chosen Firefox as browser for anything; this is a very recent fresh install of OpenSUSE; that either came out of the box or was set by Thunderbird itself).

So maybe there are two or more concepts of "default browser": the one defined by xdg-utils, which I haven't found a single application depending on except for Thunderbird, and then a more widely recognized one which I have no idea where it is stored, which Chrome itself recognizes as the way to establish itself as the default browser and that every other application I've ever clicked a link in understands.

I realize I provide no background and I'm asking more questions than I answer, however this does provide an answer that worked for me, and the only one that did.

Actually this is for Chrome, so I cannot guarantee this works for Chromium, but it definitely seems like it's applicable.

matteo
  • 2,549
0

None of these solutions worked for me. I ran thunderbird using strace, and discovered, that regardless of what value I chose for network.protocol-handler.app.http, it was always attempting to launch /usr/bin/google-chrome. I searched the preferences, and was unable to find any place where this was defined. In the end, I just did: ln -s chromium-browser /usr/bin/google-chrome , and that seemed to fix it.

Ben
  • 29
0

I was not able to use one of the methods above, but this worked for me (as of 2022-05-20) on Kubuntu linux 22.04:

  • edit configs, change network.protocol-handler.warn-external.http and network.protocol-handler.warn-external.https to true
  • click on an http and then an https link in thunderbird; for each, a dialog will appear
  • importantly, in the dialog do not simply change it to "Firefox" (this worked once for me, but not thereafter). Instead: browse to /snap/bin/firefox (which is where firefox now lives in *buntu, I take it) and check "always open" with this app

(Note: I had to delete (i.e. rename) my handlers.json because once it was set the "warn" configs no longer had an effect, and setting it through the GUI also didn't change anything. This may have side effects for other handlers, so be warned.)

If instead I used the "Firefox" option that was already in the dialog, the handlers.json file would be updated with values that did not work. I would get errors of this sort in the Thunderbird stdout console (I might have the formatting slightly wrong here): env: "http://blah.com" No such file or directory ...which makes sense if you see what it was trying to run (below).

The non-functioning handlers.json (just the "schemes" section):

        "https": {
            "action": 2,
            "handlers": [
                {
                    "name": "Firefox Web Browser",
                    "command": "env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/firefox_firefox.desktop /snap/bin/firefox %u"
                }
            ]
        },
        "http": {
            "action": 2,
            "handlers": [
                {
                    "name": "Firefox Web Browser",
                    "command": "env %u"
                }
            ],
            "ask": true
        }
    }

The functioning handlers.json, after I did things the way I described above:

        "https": {
            "action": 2,
            "handlers": [
                {
                    "name": "firefox",
                    "path": "/snap/bin/firefox"
                }
            ]
        },
        "http": {
            "action": 2,
            "handlers": [
                {
                    "name": "firefox",
                    "path": "/snap/bin/firefox"
                }
            ]
        }
    }
0

Serge Stroobandt's answer is the full: https://askubuntu.com/a/172883/646650 Under Linux the

~/.thunderbird/xxxxx.default/ 

folder the json file must to be edited too.

With your favorite editor open the handlers.json file. Eg.:

kate ~/.thunderbird/xxxxx.default/handlers.json

Search all strings to beginning with "http". And change

"Firefox webbrowser","command":"firefox %u"

part to (eg. if you want Brave Browser to use):

"Brave Web Browser","command":"/usr/bin/brave-browser-stable %u"

Don't forget to change string where the "https" text is. Note: also you can change to any web browser what you want to use. You can find the full path of your browsers using "whereis" command.

faszom
  • 11
  • 2
0

There is one other Thunderbird setting you need to check.

Preferences - Attachments - Incoming

The http and https settings there override the OS default and telling Chromium to make itself the default browser.

See this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=724461

And this for the gory details about how the default browser is determined in Thunderbird: http://kevinlocke.name/bits/2012/07/18/thunderbird-default-browser-linux/

0

This may help anyone stumbling across this later who has it stuck to Firefox

Go to settings control panel, System -> MIME Type Editor, and set each to 'Web Browser':

application/x-extension-html, application/x-extension-shtml, application/x-extension-xhtml, application/xhtml+xml, text/html

Then in settings control panel, Personal -> Preferred Applications, choose chrome

Run sudo update-alternatives --config x-www-browser and choose Chrome

Then launch /usr/bin/x-www-browser and it should start chrome

Then try in Thunderbird.

Seth
  • 59,332
mplong
  • 9
-1

I also had the same issue. And the "network.protocol-handler.warn-external.http" change did not work for me.

After some Googling i found the setting in the thunderbird preferences > Attachments > incoming.

There i changed the http and the https to the browser of my desire. And it works now.

Barry
  • 75