Skip to content

Commit

Permalink
Open additional URLs with the same TorBrowser instance
Browse files Browse the repository at this point in the history
When we looked at the history of issues about opening links with TorBrowser, we
found torproject#103 where initially the feature to open links from other applications
was added. Then some months later, the feature was removed again, as it was not
working because of torproject#157 and torproject#175. The issues was back then (~4years ago), that
when users had a normal Firefox running, urls got opened in the normal firefox
insead of TorBrowser. That was because TorBrowser had the --no-remote flag set
deep down in their code.
In the meanwhile TorBrowser removed the explicit --no-remote flag, so we are
able to use --allow-remote again.
On top of that there is another issue when we want open urls with TorBrowser:
If the LOGNAME is the same as the LOGNAME of the opened firefox, urls are still
opened in the open firefox. But if we set the LOGNAME envrionment variable
explicitly, we can make sure, that the url opens in the TorBrowser instead of
a running Firefox.

Should fix: torproject#245, torproject#259, torproject#380
  • Loading branch information
hefee committed Mar 23, 2019
1 parent 326669f commit 1f9d403
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion torbrowser_launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@ def run(self):
return

# Run Tor Browser
subprocess.call([self.common.paths['tbb']['start']], cwd=self.common.paths['tbb']['dir_tbb'])
my_env = os.environ.copy()
my_env['LOGNAME'] = "torbrowserbundleuser"
subprocess.call([self.common.paths['tbb']['start'], '--allow-remote', self.url_list], cwd=self.common.paths['tbb']['dir_tbb'], env=my_env)
sys.exit(0)

# Start over and download TBB again
Expand Down

0 comments on commit 1f9d403

Please sign in to comment.