Skip to content
Snippets Groups Projects
Verified Commit c85b94cf authored by cypherpunks1's avatar cypherpunks1 Committed by Pier Angelo Vendrame
Browse files

fixup! Bug 3455: Add DomainIsolator, for isolating circuit by domain.

Bug 43114: Fix first party detection for reader view on Android
parent b3633798
No related branches found
No related tags found
1 merge request!1222Bug 43166: Rebased alpha onto 128.3.0esr
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment