[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-140.3.0esr-15.0-1] fixup! BB 19741: Fix FPI with OpenSearch.



Title: GitLab

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

Commits:

  • 55015024
    by Pier Angelo Vendrame at 2025-09-30T11:36:17+02:00
    fixup! BB 19741: Fix FPI with OpenSearch.
    
    Fix the principal and add FPD also to opensearch images.
    

2 changed files:

Changes:

  • browser/components/search/SearchUIUtils.sys.mjs
    ... ... @@ -184,7 +184,7 @@ export var SearchUIUtils = {
    184 184
           await Services.search.addOpenSearchEngine(
    
    185 185
             locationURL,
    
    186 186
             image,
    
    187
    -        browsingContext?.originAttributes
    
    187
    +        browsingContext?.embedderElement?.contentPrincipal?.originAttributes
    
    188 188
           );
    
    189 189
         } catch (ex) {
    
    190 190
           let titleMsgName;
    

  • toolkit/components/search/SearchUtils.sys.mjs
    ... ... @@ -253,10 +253,21 @@ export var SearchUtils = {
    253 253
         }
    
    254 254
         try {
    
    255 255
           let uri = typeof url == "string" ? Services.io.newURI(url) : url;
    
    256
    -      let principal =
    
    257
    -        uri.scheme == "moz-extension"
    
    258
    -          ? Services.scriptSecurityManager.createContentPrincipal(uri, {})
    
    259
    -          : Services.scriptSecurityManager.createNullPrincipal({});
    
    256
    +      let principal;
    
    257
    +      if (uri.scheme == "moz-extension") {
    
    258
    +        principal = Services.scriptSecurityManager.createContentPrincipal(
    
    259
    +          uri,
    
    260
    +          {}
    
    261
    +        );
    
    262
    +      } else {
    
    263
    +        let originAttributes = {};
    
    264
    +        try {
    
    265
    +          originAttributes.firstPartyDomain =
    
    266
    +            Services.eTLD.getSchemelessSite(uri);
    
    267
    +        } catch {}
    
    268
    +        principal =
    
    269
    +          Services.scriptSecurityManager.createNullPrincipal(originAttributes);
    
    270
    +      }
    
    260 271
     
    
    261 272
           return Services.io.newChannelFromURI(
    
    262 273
             uri,
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx