Thunderbird links open in Chrome / Chromium in incognito mode

For quite some time, I have tried to get links in Thunderbird to open automatically in Chrome or Chromium instead of defaulting to Firefox. Moreover, I have Chromium start in incognito mode by default, and I would like those links to do the same. This has been a problem for me since I don’t use a full desktop environment like KDE, GNOME, or even XFCE. As I’m really a minimalist, I only have my window manager (which is Openbox), and the applications that I use on a regular basis.

One thing I found, though, is that by using PCManFM as my file manager, I do have a few other related applications and utilities that help me customise my workspace and workflows. One such application is libfm-pref-apps, which allows for setting preferred applications. I found that I could do just what I wanted to do without mucking around with manually setting MIME types, writing custom hooks for Thunderbird, or any of that other mess.

Here’s how it was done:

  1. Execute /usr/bin/libfm-pref-apps from your terminal emulator of choice
  2. Under “Web Browser,” select “Customise” from the drop-down menu
  3. Select the “Custom Command Line” tab
  4. In the “Command line to execute” box, type /usr/bin/chromium --incognito --start-maximized %U
  5. In the “Application name” box, type “Chromium incognito” (or however else you would like to identify the application)

Voilà! After restarting Thunderbird, my links opened just like I wanted them to. The only modification that you might need to make is the “Command line to execute” portion. If you use the binary of Chrome instead of building the open-source Chromium browser, you would need to change it to the appropriate executable (and the path may be different for you, depending on your system and distribution). Also, in the command line that I have above, here are some notes about the switches used:

  • –incognito starts Chromium in incognito mode by default (that one should be obvious)
  • –start-maximized makes the browser window open in the full size of your screen
  • %U allows Chromium to accept a URL or list of URLs, and thus, opens the link that you clicked in Thunderbird

Under the hood, it seems like libfm-pref-apps is adding some associations in the ~/.config/mimeapps.list file. The relevant lines that I found were:

[Added Associations]
x-scheme-handler/http=userapp-chromium --incognito --start-maximized-8KZNYX.desktop;
x-scheme-handler/https=userapp-chromium --incognito --start-maximized-8KZNYX.desktop;

Hope this information helps you get your links to open in your browser of choice (and with the command-line arguments that you want)!

Cheers,
Zach

6 comments

Skip to comment form

    • david on Wednesday, 14 June 2017 at 11:44
    • Reply

    Hello,
    maybe u might be able to help:

    I use thunderbird for email and Chrome as a browser.
    Reading Emails most of the times I like to use the standard mode (use chrome to open open link),
    but in some 25% of all times, I’d love to open the Link within an email with right mouse click (~open link in incognito mode) – I have already researched quite some time to resolve this need, now i stumbled over your effort, which comes pretty close. My need would be: keep as is, but with option: right mouseclick context menu in thunderbird to: open in incognito mode of the default browser. I do not have a lot money but I’d be willing to be rewrd 25$ for that, which may be only symbolic, but more i can’t.

    Any ideas? ๐Ÿ™‚
    Greetings!

      • Zach on Wednesday, 14 June 2017 at 11:47
        Author
      • Reply

      Hello David,

      You can set the browser accordingly, but then you will need a context menu plugin for changing it with right-click options. Check out this plugin:

      https://addons.mozilla.org/en-US/thunderbird/addon/open-with/?src=search

      That should allow you to customise accordingly.

      Hope that helps.

      Cheers,
      Zach

      1. He Zach, thanx so much, I only found our answer after so much time almost accidentally.:)
        – I already tried, and wow: yes it works almost 99% as I wanted it and 120% easier than I had wished. ๐Ÿ™‚ lol

        Fantastiiic!
        Cheers!
        David.

          • Zach on Tuesday, 7 November 2017 at 13:31
            Author
          • Reply

          Hi David,

          You’re welcome. I’m glad that the article helped you with that problem. Thank you VERY much for your donation to the Parker Fund; I greatly appreciate it!

          Cheers,
          Zach

  1. thanks for the explanation of the entrance to Thunderbird via chrome, nice article

      • Zach on Wednesday, 12 August 2015 at 10:13
        Author
      • Reply

      You’re welcome, Bayu. I hope that it helped.

      Cheers,
      Zach

Leave a Reply

Your email address will not be published.