Pier Angelo Vendrame pushed to branch tor-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits: bc937da4 by cypherpunks1 at 2024-09-04T16:34:55+00:00 fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain.
Bug 43114: Fix first party detection for reader view on Android
- - - - -
1 changed file:
- toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs
Changes:
===================================== toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs ===================================== @@ -315,17 +315,23 @@ class TorDomainIsolatorImpl { const channel = aChannel.QueryInterface(Ci.nsIChannel); let firstPartyDomain = channel.loadInfo.originAttributes.firstPartyDomain; const userContextId = channel.loadInfo.originAttributes.userContextId; - const loadingPrincipalURI = channel.loadInfo.loadingPrincipal?.URI; - if (loadingPrincipalURI?.spec.startsWith("about:reader")) { + const scheme = channel.loadInfo.loadingPrincipal?.URI?.scheme; + const filePath = channel.loadInfo.loadingPrincipal?.URI?.filePath; + if ( + (scheme === "about" && filePath === "reader") || + (scheme === "moz-extension" && filePath === "/readerview.html") + ) { try { - const searchParams = new URLSearchParams(loadingPrincipalURI.query); + const searchParams = new URLSearchParams( + channel.loadInfo.loadingPrincipal.URI.query + ); if (searchParams.has("url")) { firstPartyDomain = Services.eTLD.getSchemelessSite( Services.io.newURI(searchParams.get("url")) ); } } catch (e) { - logger.error("Failed to get first party domain for about:reader", e); + logger.error("Failed to get first party domain for reader view", e); } } if (!firstPartyDomain) {
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/bc937da4...
tbb-commits@lists.torproject.org