Skip to content
Snippets Groups Projects
Commit 5db35e85 authored by cypherpunks1's avatar cypherpunks1
Browse files

fixup! Bug 40925: Implemented the Security Level component

Bug 26277: Skip the redirection page when searching with DuckDuckGo on the safest security level
parent cf8bb1df
No related branches found
Tags tor-browser-102.12.0esr-12.5-1-build2
1 merge request!672Bug 26277: Skip the redirection page when searching with DuckDuckGo on the safest security level
......@@ -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";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment