Pier Angelo Vendrame pushed to branch tor-browser-102.12.0esr-13.0-1 at The Tor Project / Applications / Tor Browser
Commits: 5db35e85 by cypherpunks1 at 2023-06-08T23:51:40-08:00 fixup! Bug 40925: Implemented the Security Level component
Bug 26277: Skip the redirection page when searching with DuckDuckGo on the safest security level
- - - - -
1 changed file:
- toolkit/components/search/SearchEngine.jsm
Changes:
===================================== toolkit/components/search/SearchEngine.jsm ===================================== @@ -30,6 +30,12 @@ XPCOMUtils.defineLazyGetter(this, "logConsole", () => { }); });
+XPCOMUtils.defineLazyScriptGetter( + this, + "SecurityLevelPrefs", + "chrome://browser/content/securitylevel/securityLevel.js" +); + const USER_DEFINED = "searchTerms";
// Supported OpenSearch parameters @@ -429,7 +435,17 @@ class EngineURL { }
getSubmission(searchTerms, engine, purpose) { - var url = ParamSubstitution(this.template, searchTerms, engine); + let urlTemplate = this.template; + if ( + engine && + (engine._extensionID === "ddg@search.mozilla.org" || + engine._extensionID === "ddg-onion@search.mozilla.org") && + this.type === SearchUtils.URL_TYPE.SEARCH && + SecurityLevelPrefs?.securityLevel === "safest" + ) { + urlTemplate += "html"; + } + var url = ParamSubstitution(urlTemplate, searchTerms, engine); // Default to searchbar if the purpose is not provided var requestPurpose = purpose || "searchbar";
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5db35e85...
tor-commits@lists.torproject.org