Skip to content

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

Ok this is a lot but here's the general summary. The bulk of the changes are in the following files:

  • TorConnect.jsm - the singleton TorConnect module that was added to send out the torconnect:bootstrap-complete notification. This module is now the sole manager of TorConnect related state and state transitions. All the actual functionality now lives here (previously it was spread between TorConnectParent.jsm and aboutTorConnect.js). A handy state-machine diagaram also lives here.
  • TorConnectParent.jsm - this is code that is able to access the TorConnect module, and also interface with each aout:torconnect page. It now serves solely as a pass-through between the TorConnect module and the about:torconnect code. Lifecycle events from the module are received here, and translated into something useful for the about:torconnect. It also passes up commands from the UI to the module.
  • aboutTorConnect.js - this is the js code that actually lives in each client page. The state management used to live here, and listened to tor-launcher lifecycle events directly. Now TorConnectParent.jsm pushes down 'state' objects which aboutTorConnect.js uses to update the UI (and that's about it).

Side-by-side diffs of these files probably won't be particularly illuminating.

The remainder of the changes are small tweaks throughout the rest of the system to interface with the TorConnect module directly (where possible).

I've verified the following scenarios work:

  • using legacy tor launcher via the TOR_USE_LEGACY_LAUNCHER=1 env variable
  • multiple home pages
  • using the built-in password manager
  • OnionStoreAlias init (though this seems to always be triggered after bootstrap occurs now, I don't know why)
  • connecting from about:preferences#tor (more work can be done here to clean things up)

TODO:

  • verify that update checks still work (need to make a Nighty build to do this)

Closing #40534 (closed) #40561 (closed)

Edited by Matthew Finkel

Merge request reports