If I do tor-browser_en-US/App/Firefox/firefox-bin http://example.com it opens in my regular Firefox browser. Is there a way to make a launcher/script that opens a link in the Tor Browser?


Currently the start-tor-browser script and vidalia form the Tor Browser Bundle is not prepared to pass arguments to the launched Firefox. See this part of the script (near to the end):

printf "\nLaunching Tor Browser Bundle for Linux in ${HOME}\n"
cd "${HOME}"
# XXX Someday we should pass whatever command-line arguments we got
# (probably filenames or URLs) to Firefox.
./App/vidalia --datadir Data/Vidalia/ -style Cleanlooks

The last command results in launching Firefox.

It is possible to close the browser launched through vidalia and then to start it manually. Here is a procedure:

  1. Copy the start-tor-browser script to start-tor-browser-only.
  2. In start-tor-browser-only replace the line ./App/vidalia --datadir Data/Vidalia/ -style Cleanlooks near to the end by ./App/Firefox/firefox -no-remote -profile Data/profile "$@"
  3. Make sure that the executable bit is set: chmod a+x start-tor-browser-only
  4. Run the start-tor-browser script.
  5. Close the browser window. Now just the tor daemon and vidalia are running. Processes can communicate through tor by using it as a socks proxy.
  6. Start start-tor-browser-only http://your.address.

This way you can start the Firefox with parameters as you want. It will be started with the correct profile and correct environment variables: HOME, XAUTHORITY, LD_LIBRARY_PATH and LDPATH. Unfortunately the debug mode will not work and probably there would be several other minor catches and security implications.

  • 2
    For one, you won't be starting the browser with the environment variables that tell the Torbutton Firefox extension how to talk to Tor's control port. That means when you click 'new identity' in Torbutton, it won't be able to tell Tor to rotate to fresh circuits. So this is a fine hack if you want to play around with it, but it seems a poor choice for normal users. – Roger Dingledine Sep 26 '13 at 9:30
  • 1
    Also, I'd encourage people to investigate this question in the context of TBB 3.x, which doesn't have Vidalia anymore and is simply the browser: blog.torproject.org/category/tags/tbb-30 – Roger Dingledine Sep 26 '13 at 9:31
  • It at least lets me avoid having to restart vidalia if I've quit the browser, so that's a timesaver. I was hoping there was a way to open an URL in the running browser (ie. without the "-no-remote"), but I guess that's not possible yet. – unhammer Sep 26 '13 at 13:37
  • @unhammer: If you want you can remove the -no-remote parameter in start-tor-browser-only then you can control the Tor Firefox browser by running firefox but there is a risk that you open some URLs through Tor though they should have been opened in clear and vice versa. Unfortunately -no-remote seems to be hardcoded in the binaries launching the first instance of Firefox. – pabouk Sep 26 '13 at 14:16
  • On my system I get Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system. if I'm running just Tor Browser, while it opens in the regular Firefox if I'm running that as well. – unhammer Sep 27 '13 at 7:21

As noted in the comments, 3.X series of the Tor Browser Bundle ships without Vidalia and now it's easier to launch it with a URL (or any other command line option that Firefox would be happy with).

Here is a modified start-tor-browser script that will pass all arguments to Tor Browser while preserving environment variables set by the original script:

  • start-tbb-with-args (place in TBB root dir, same dir as the start-tor-browser, give execution permission with chmod u+x)

Some possible commands would be:

  • start-tbb-with-args torproject.org
    open torproject.org
  • start-tbb-with-args about:tor torproject.org
    open about:tor and torproject.org (will open 2 tabs)
  • start-tbb-with-args -search Tor
    search for the word "Tor" using TBB's default search engine (=startpage)
  • start-tbb-with-args --debug torproject.org
    run TBB in debug mode and open torproject.org

Note that, whenever present, TBB's --debug option will be processed correctly and excluded from the passed params using shift.

You can review the patch (vs. TBB v3.5) which is quite minimal (only 13 characters were changed/added!)

Please use the script at your own risk! Not sure about what kind of security/privacy problems this modification may bring!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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