Skip to content

fixup! Bug 27476: Implement about:torconnect captive portal within Tor Browser

Fixes: #40528 (closed)

The previous fix delay-loads TorProtocolService and TorConnect in BrowserGlue.jsm to aviod the 'init before we have a profile' problem that breaks the password manager. Unfortunately nothing is currently explicitly calling code in the TorConnect module (only currently listening for the bootstrap-complete message) so as a result, the now lazy-loaded TorConnect module is never loaded. This causes the breakage where we seem stuck on about:torconnect, since the TorConnect module (which was never loaded) is in charge of opening up the user's home page(s) and notifying the about:torconnect tab(s) to close.

The fix is to just explicitly load the TorConnect module when an about:torconnect page is opened by adding the load to the TorConnectParent.jsm source.

This all seems really gross and poorly defined, because it is. I'm working on another patch which centralizes the TorConnect state transitions/management into the TorConnect.jsm module rather than within the about:torconnect pages, so that there is 1 single source of truth, and well-defined entry point into the system.

Merge request reports