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

[tor-commits] [Git][tpo/applications/mullvad-browser][mullvad-browser-128.2.0esr-14.0-1] fixup! Bug 40925: Implemented the Security Level component



Title: GitLab

morgan pushed to branch mullvad-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Mullvad Browser

Commits:

  • e155be94
    by Pier Angelo Vendrame at 2024-09-03T19:16:01+00:00
    fixup! Bug 40925: Implemented the Security Level component
    
    Bug 42617: Use DDG's plain HTML variant on Safest.
    
    Between 115 and 128 we lost the engine parameter, so we are not given
    the search engine's ID anymore.
    So, switch to comparing the hostname instead.
    

1 changed file:

Changes:

  • toolkit/components/search/SearchEngine.sys.mjs
    ... ... @@ -12,6 +12,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
    12 12
       NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
    
    13 13
       SearchSettings: "resource://gre/modules/SearchSettings.sys.mjs",
    
    14 14
       SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
    
    15
    +  SecurityLevelPrefs: "resource://gre/modules/SecurityLevel.sys.mjs",
    
    15 16
       OpenSearchEngine: "resource://gre/modules/OpenSearchEngine.sys.mjs",
    
    16 17
     });
    
    17 18
     
    
    ... ... @@ -439,6 +440,26 @@ export class EngineURL {
    439 440
        */
    
    440 441
       getSubmission(searchTerms, queryCharset, purpose) {
    
    441 442
         var url = ParamSubstitution(this.template, searchTerms, queryCharset);
    
    443
    +
    
    444
    +    if (
    
    445
    +      lazy.SecurityLevelPrefs?.securityLevel === "safest" &&
    
    446
    +      this.type === lazy.SearchUtils.URL_TYPE.SEARCH
    
    447
    +    ) {
    
    448
    +      let host = this.templateHost;
    
    449
    +      try {
    
    450
    +        host = Services.eTLD.getBaseDomainFromHost(host);
    
    451
    +      } catch (ex) {
    
    452
    +        lazy.logConsole.warn("Failed to get a FPD", ex, host);
    
    453
    +      }
    
    454
    +      if (
    
    455
    +        host === "duckduckgo.com" ||
    
    456
    +        host ===
    
    457
    +          "duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion"
    
    458
    +      ) {
    
    459
    +        url += "html";
    
    460
    +      }
    
    461
    +    }
    
    462
    +
    
    442 463
         // Default to searchbar if the purpose is not provided
    
    443 464
         var requestPurpose = purpose || "searchbar";
    
    444 465
     
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits