Pier Angelo Vendrame pushed to branch tor-browser-128.9.0esr-14.5-1 at The Tor Project / Applications / Tor Browser
Commits: 9e832b90 by Pier Angelo Vendrame at 2025-04-03T09:05:32+02:00 fixup! TB 3455: Add DomainIsolator, for isolating circuit by domain.
TB 43604: fix DomainIsolator.#clearKnownCircuits on Android.
Window type "navigator:browser" does not match GeckoView sessions. So, in addition to that, we iterate on "navigator:geckoview" windows.
- - - - -
1 changed file:
- toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs
Changes:
===================================== toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs ===================================== @@ -543,11 +543,12 @@ class TorDomainIsolatorImpl { return; }
+ const circuit = this.#knownCircuits.get(id); logger.debug( - `Found new credentials ${username} ${password} for browser`, - browser + `Found new credentials ${username} ${password} for browser ${browser.browserId}.`, + browser, + circuit ); - const circuit = this.#knownCircuits.get(id); if (circuit?.length) { circuitIds.current = id; if (circuitIds.pending === id) { @@ -634,15 +635,23 @@ class TorDomainIsolatorImpl { */ #clearKnownCircuits() { logger.info("Running the circuit cleanup"); - const windows = []; - const enumerator = Services.wm.getEnumerator("navigator:browser"); - while (enumerator.hasMoreElements()) { - windows.push(enumerator.getNext()); - } - const browsers = windows - .flatMap(win => win.gBrowser.browsers.map(b => b.browserId)) - .filter(id => this.#browsers.has(id)); - this.#browsers = new Map(browsers.map(id => [id, this.#browsers.get(id)])); + const getWindows = type => { + const windows = []; + const enumerator = Services.wm.getEnumerator(type); + while (enumerator.hasMoreElements()) { + windows.push(enumerator.getNext()); + } + return windows; + }; + const browserIds = [ + ...getWindows("navigator:browser").flatMap(win => + win.gBrowser.browsers.map(b => b.browserId) + ), + ...getWindows("navigator:geckoview").map(gv => gv.browser.browserId), + ].filter(id => this.#browsers.has(id)); + this.#browsers = new Map( + browserIds.map(id => [id, this.#browsers.get(id)]) + ); this.#knownCircuits = new Map( Array.from(this.#browsers.values(), circuits => Array.from(circuits.values(), ids => {
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/9e832b90...
tbb-commits@lists.torproject.org