Pier Angelo Vendrame pushed to branch tor-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser

Commits:

1 changed file:

Changes:

  • toolkit/components/tor-launcher/TorDomainIsolator.sys.mjs
    ... ... @@ -315,17 +315,23 @@ class TorDomainIsolatorImpl {
    315 315
           const channel = aChannel.QueryInterface(Ci.nsIChannel);
    
    316 316
           let firstPartyDomain = channel.loadInfo.originAttributes.firstPartyDomain;
    
    317 317
           const userContextId = channel.loadInfo.originAttributes.userContextId;
    
    318
    -      const loadingPrincipalURI = channel.loadInfo.loadingPrincipal?.URI;
    
    319
    -      if (loadingPrincipalURI?.spec.startsWith("about:reader")) {
    
    318
    +      const scheme = channel.loadInfo.loadingPrincipal?.URI?.scheme;
    
    319
    +      const filePath = channel.loadInfo.loadingPrincipal?.URI?.filePath;
    
    320
    +      if (
    
    321
    +        (scheme === "about" && filePath === "reader") ||
    
    322
    +        (scheme === "moz-extension" && filePath === "/readerview.html")
    
    323
    +      ) {
    
    320 324
             try {
    
    321
    -          const searchParams = new URLSearchParams(loadingPrincipalURI.query);
    
    325
    +          const searchParams = new URLSearchParams(
    
    326
    +            channel.loadInfo.loadingPrincipal.URI.query
    
    327
    +          );
    
    322 328
               if (searchParams.has("url")) {
    
    323 329
                 firstPartyDomain = Services.eTLD.getSchemelessSite(
    
    324 330
                   Services.io.newURI(searchParams.get("url"))
    
    325 331
                 );
    
    326 332
               }
    
    327 333
             } catch (e) {
    
    328
    -          logger.error("Failed to get first party domain for about:reader", e);
    
    334
    +          logger.error("Failed to get first party domain for reader view", e);
    
    329 335
             }
    
    330 336
           }
    
    331 337
           if (!firstPartyDomain) {