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

share|improve this question

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
share|improve this answer
    
Terminal returns: update-alternatives: --install needs <link> <name> <path> <priority> and must use different command: sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /path/to/torbrowser/executable [integer like 1, 2, 3, ..]. Nonetheless, this command (followed by sudo update-alternatives --config x-www-browser) still opens Firefox perhaps because running the executable script would try to launch a completely new Tor Network connection/interface rather than simply opening a "New Window" if the browser is already open and running. – jtd Oct 27 '14 at 19:46
    
Did you try the gnome-www-browser variant as well? – Chuck R Oct 27 '14 at 19:46
    
Sorry, fixed the command (just add a 1 to the end) – Chuck R Oct 27 '14 at 19:48
    
Yes, both x-www-browser and gnome-www-browser are pointing to executable script (Selection: 1, Priority: 1, Status: manual mode) and Ubuntu opens new standard Firefox application and Window rather than "New Window" within Tor Browser. Firefox has two entries at Selection: 0, Priority: 40, and Status: auto mode and Selection: 2, Priority: 40, and Status: manual mode – jtd Oct 27 '14 at 19:57
    
If when you run sudo udpate-alternatives --config x-www-browser the "Path" column says /usr/bin/firefox, then that's not the correct one to select. There should be an entry for /path/to/start-tor-browser (wherever that file is). That is the purpose of the update-alternatives --install command. The command I had in there originally was malformed, but I've fixed it. It wouldn't have added it the first time because the command was wrong. So, try the update-alernatives --instal... command again with what I have up there (be sure to replace the path correctly). Then --config should work – Chuck R Oct 27 '14 at 20:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.