Ubuntu – Set Tor Browser as default browser

browserdefault-programstor

I would like Ubuntu to automatically use the Tor Browser as its default browser. As it launches from the script start-tor-browser and is perhaps not truly "installed" in the same way as Firefox or Chrome, I can't figure out how to do so even after looking at these relevant answers:

How can I set the Tor Browser as my default browser in Ubuntu and open the appropriate files as "New Window"s in Tor Browser even if the Tor Browser is already up, running, and connected?

Ubuntu 14.04

Best Answer

System-wide change

The default browser is determined by the x-www-browser alternative.

In order to add the Tor browser to the list of available options, you have to run this command:

sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /path/to/torbrowser/executable 1

Then, you need to select it as the default by using

sudo update-alternatives --config x-www-browser

You may also do the same for gnome-www-browser as well.

Note that this is a system-wide change. If you're looking to change it for just your user, let me know.


Change for a single user only

In order to set this is the default for a single user, a little more work may be required (but not much).

gedit ~/.local/share/applications/torbrowser.desktop

Paste the following into the file and save (be sure to use the real path of the Tor browser script):

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=browser
Name[en_US]=Tor Browser
Exec=/path/to/tor/browser
Name=Tor Browser
Icon=browser

Then, execute the command:

xdg-settings set default-web-browser torbrowser.desktop