2

I would like to open links from Thunderbird in non-default browser.

I came across this old post here, but even after setting network.protocol-handler.warn-external.http AND network.protocol-handler.warn-external.https to true Thunderbird does not prompt for the browser to use, and instead uses the default one

0

3 Answers 3

2

Do this :

  • Open Thunderbird menu Tools > Settings
  • Position to the General section
  • Under "Files & Attachments", scroll down and find "default-browser HTML Document"
  • Click on the drop-down mark and select "Always ask".
1
  • Thanks not sure why I could not find it earlier Commented Mar 29, 2023 at 21:33
2

Updated instructions are:

After using the Config Editor to set network.protocol-handler.warn-external.http and network.protocol-handler.warn-external.https to true, you then have to click on a http and https hyperlink in an email.

After this, go to Tools > Settings > Scroll down to "Files & Attachments" and you will see 2 new entries for "http" and "https". Click the corresponding drop down menu in the "Action" column and choose "Use other..." > Then click the "Browse..." button and navigate to the .exe of the web browser that you want to use. For example, Microsoft Edge is at C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe.

If you ever want to undo this change, you can choose to use your operating system set default browser again from the "Action" column - it will have "(default)" besides it. Alternatively, you can undo all changes by deleting the "http" and "https" actions altogether and reversing the config editor modifications.

4
  • 1
    I did find and set "true' the items you mentioned in the config editor. Then in my mail tab I clicked on an https link in an email. It latched the 'default browser as usual, and still there is no default browser setting in the list you describe. v. 102.0.2 64 bit/ windows until I restarted. But the "use other" is not very useful I think, because whatever I enter becomes the new default. I think what we and the OP hope for is a behavior where clicking a link opens a drop-down list of existing browsers registered in the system
    – Randy
    Commented Dec 1, 2023 at 16:20
  • @Randy I also had to restart after updating the config before clicking links in emails to get the entries to show up in the Files & Attachments list. Pointing the handler to the stock Firefox application at /bin/firefox (I'm on Linux) worked. However, I ideally wanted to make the handler use a particular Firefox profile, but it seems to only accept paths (e.g. /bin/firefox) and not commands (e.g. /bin/firefox -P my-profile). Firefox also seems to reject entries that aren't registered as system HTTP(S) handlers in the system so you can't easy work around it with a custom script.
    – Sean
    Commented Feb 19 at 10:56
  • Despite trying the above as well as other proffered fixes, and with many restarts, and despite changing my default browser to Vivaldi in W/1 Settings under Default Apps, in Config editor Thunderbird only offered one link type for which an option was available for a alternative browser. Thus T-board l would only open links in emails in Edge. The solution was to Choose a default app for each file type in W/11 settings and make my preferred browser the default. i.postimg.cc/YSLPwSRN/1-1-5.jpg Commented Feb 23 at 16:10
  • After a 23H2 and Tbird 115.10.1 (64-bit) update, Under Tools > Settings > "Files & Attachments">entries for "http" and "https">drop down menu in the "Action" column> "Use other..." > "Browse..." button, results in :no applications were found for this file type" (http) even though, as b4, Vivaldi is set for both http and https. However, having restarting T-bird it works now. Commented May 7 at 0:12
0

Certainly! Below are concise descriptions and explanations for both the C# and Python solutions to open Firefox with a specific profile from Thunderbird. Although it is a workaround, it works perfectly for me. These descriptions aim to guide someone on how to create a small application in either programming language to achieve this task.

Finally, you then select your created .exe instead of the browser, which then starts the browser with your profile.

C# Solution

Opening Firefox with a Specific Profile from Thunderbird using C#

If you're looking to open Firefox with a specific profile from Thunderbird, one effective method is to create a small C# console application (.exe) that acts as an intermediary. This application will receive a URL as an argument and launch Firefox with the desired profile to open that URL. Here's how you can set it up:

  1. Create a Console Application in Visual Studio: Start a new project and select "Console Application" as the project type. Choose either .NET Core or .NET Framework depending on your requirements.

  2. Replace the Code in Program.cs: Use the following C# code snippet in your Program.cs file. This code checks for a URL argument, and if present, launches Firefox with the specified profile and URL.

using System; using System.Diagnostics;

class Program
{
    static void Main(string[] args)
    {
        string firefoxPath = @"C:\Program Files\Mozilla Firefox\firefox.exe";
        string profilePath = @"N:\FIREFOX_PROFILE";
        string url = args.Length > 0 ? args[0] : "";

        if (!string.IsNullOrEmpty(url))
        {
            Process.Start(firefoxPath, $"-profile \"{profilePath}\" {url}");
        }
        else
        {
            Console.WriteLine("No URL provided.");
        }
    }
}
  1. Adjust Paths Accordingly: Make sure to replace firefoxPath and profilePath with your actual Firefox executable and profile paths.

  2. Compile and Use: Compile your project to generate an executable. You can then configure Thunderbird or your operating system to use this executable as the default browser, enabling links to open in Firefox with the specified profile.

Python Solution

Opening Firefox with a Specific Profile from Thunderbird using Python

For those preferring Python, you can achieve the same functionality by creating a small Python script. This script also serves as an intermediary, launching Firefox with a given profile when opening a URL from Thunderbird. Here’s a step-by-step guide:

Write Your Python Script: Save the following code as open_firefox_with_profile.py. This script accepts a URL as a command-line argument and launches Firefox with the specified profile to open that URL.

import sys
import subprocess

firefox_path = "C:\\Program Files\\Mozilla Firefox\\firefox.exe"
profile_path = "N:\\FIREFOX_PROFILE"
url = sys.argv[1] if len(sys.argv) > 1 else None

if url:
    subprocess.run([firefox_path, "-profile", profile_path, url])
else:
    print("No URL provided.")
  1. Adjust Paths: Ensure the firefox_path and profile_path in the script match the paths on your system.

  2. Make the Script Executable: Depending on your operating system, you might need to make the script directly executable. On Windows, you can convert this script to an executable (.exe) using tools like PyInstaller.

  3. Integrate with Thunderbird: Configure Thunderbird or your system to use this script (or its compiled executable form) as the default browser. This allows opening links in Firefox with the desired profile.

Both solutions require adjusting system or Thunderbird settings to use the new executable or script as the default method for opening links. This enables you to open links from Thunderbird in Firefox with the specified profile, enhancing your workflow and browser organization.

Addendum: This setting must be made for http and https. I couldn't find the http setting in the Thunderbird settings, so I had to do this manually in the Thunderbird profile folder (%appdata%\Thunderbird\profiles\{yourprofile}\handlers.json).

Unfortunately, the JSON is compressed and difficult to read (no breaks, spaces, etc.) I use the editor Notpad++ and the "JSON Viewer" plugin for this. This allows the JSON to be formatted in a readable format and then compressed again.

My schemes section looks like this:

"schemes": {
    "https": {
        "action": 2,
        "handlers": [
            {
                "name": "mybrowser.exe",
                "path": "C:\\{yourPath}\\mybrowser.exe"
            },
            {
                "name": "firefox.exe",
                "path": "C:\\Program Files\\Mozilla Firefox\\firefox.exe"
            }
        ]
    },
    "http": {
        "action": 2,
        "handlers": [
            {
                "name": "mybrowser.exe",
                "path": "C:\\{yourPath}\\mybrowser.exe"
            },
            {
                "name": "firefox.exe",
                "path": "C:\\Program Files\\Mozilla Firefox\\firefox.exe"
            }
        ]
    }
},
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .