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

morgan (@morgan) git at gitlab.torproject.org
Tue Sep 3 19:15:31 UTC 2024



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


Commits:
cf748728 by Pier Angelo Vendrame at 2024-09-03T19:12:17+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:

- toolkit/components/search/SearchEngine.sys.mjs


Changes:

=====================================
toolkit/components/search/SearchEngine.sys.mjs
=====================================
@@ -12,6 +12,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
   NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
   SearchSettings: "resource://gre/modules/SearchSettings.sys.mjs",
   SearchUtils: "resource://gre/modules/SearchUtils.sys.mjs",
+  SecurityLevelPrefs: "resource://gre/modules/SecurityLevel.sys.mjs",
   OpenSearchEngine: "resource://gre/modules/OpenSearchEngine.sys.mjs",
 });
 
@@ -439,6 +440,26 @@ export class EngineURL {
    */
   getSubmission(searchTerms, queryCharset, purpose) {
     var url = ParamSubstitution(this.template, searchTerms, queryCharset);
+
+    if (
+      lazy.SecurityLevelPrefs?.securityLevel === "safest" &&
+      this.type === lazy.SearchUtils.URL_TYPE.SEARCH
+    ) {
+      let host = this.templateHost;
+      try {
+        host = Services.eTLD.getBaseDomainFromHost(host);
+      } catch (ex) {
+        lazy.logConsole.warn("Failed to get a FPD", ex, host);
+      }
+      if (
+        host === "duckduckgo.com" ||
+        host ===
+          "duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion"
+      ) {
+        url += "html";
+      }
+    }
+
     // 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/cf74872888985ce165420aa78917ea5b4c60327b

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/cf74872888985ce165420aa78917ea5b4c60327b
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20240903/826a2a46/attachment-0001.htm>


More information about the tor-commits mailing list