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

Commits:

1 changed file:

Changes:

  • toolkit/components/search/SearchEngine.jsm
    ... ... @@ -30,6 +30,12 @@ XPCOMUtils.defineLazyGetter(this, "logConsole", () => {
    30 30
       });
    
    31 31
     });
    
    32 32
     
    
    33
    +XPCOMUtils.defineLazyScriptGetter(
    
    34
    +  this,
    
    35
    +  "SecurityLevelPrefs",
    
    36
    +  "chrome://browser/content/securitylevel/securityLevel.js"
    
    37
    +);
    
    38
    +
    
    33 39
     const USER_DEFINED = "searchTerms";
    
    34 40
     
    
    35 41
     // Supported OpenSearch parameters
    
    ... ... @@ -429,7 +435,17 @@ class EngineURL {
    429 435
       }
    
    430 436
     
    
    431 437
       getSubmission(searchTerms, engine, purpose) {
    
    432
    -    var url = ParamSubstitution(this.template, searchTerms, engine);
    
    438
    +    let urlTemplate = this.template;
    
    439
    +    if (
    
    440
    +      engine &&
    
    441
    +      (engine._extensionID === "ddg@search.mozilla.org" ||
    
    442
    +        engine._extensionID === "ddg-onion@search.mozilla.org") &&
    
    443
    +      this.type === SearchUtils.URL_TYPE.SEARCH &&
    
    444
    +      SecurityLevelPrefs?.securityLevel === "safest"
    
    445
    +    ) {
    
    446
    +      urlTemplate += "html";
    
    447
    +    }
    
    448
    +    var url = ParamSubstitution(urlTemplate, searchTerms, engine);
    
    433 449
         // Default to searchbar if the purpose is not provided
    
    434 450
         var requestPurpose = purpose || "searchbar";
    
    435 451