[tbb-dev] Torbutton and Tor-Launcher Webextensions

Matthew Finkel matthew.finkel at gmail.com
Thu Dec 6 20:56:20 UTC 2018


Hi all,

The next steps for torbutton and tor-launcher will be migrating from the
restartless pieces to webextensions. This will be a requirement for the
next ESR, and it is already the situation with the current Firefox
releases. Also, they must be system add-ons.

Overall, we believe nearly everything torbutton and tor-launcher
currently do can be accomplished with webextensions (assuming I
remembered all the things they do). The key here is using a
"Webextensions Experiment" for extending the Webextensions API for our
needs.

https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/basics.html#built-in-apis-versus-experiments

This should be enough for interacting with the XPCOM services the
extensions currently use.

The one problem we will have is observing the profile-after-change
topic. We'll likely need another Firefox patch so we can trigger the
current functionality. The main reason we can't achieve this with
webextensions is webextensions are run asynchronously, so a webextension
won't block the browser start-up progress (needed for TorProcessService
in tor-launcher, and parts of torbutton).

In torbutton, we may be able to provide domain isolation using the
webRequest.onBeforeRequest event:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeRequest

On this event, we should receive information about the connection,
including the ProxyInfo. I wonder if we can use the current
implementation in torbutton and overwrite the ProxyInfo object we're
given from the request with a new domain-isolated ProxyInfo object. I
haven't looked at the Firefox code, so I'm not sure if Firefox will use
the modifications or ignore it.

Personally, I think we should begin working on this within the next
month or two, and begin testing the new implementation in the alpha
series before we start rebasing Tor Brower onto the next ESR. 

- Matt


More information about the tbb-dev mailing list