[tbb-commits] [Git][tpo/applications/mullvad-browser][mullvad-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:16:30 UTC 2024



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:

- 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/mullvad-browser/-/commit/e155be94eb77b8209369b61281cd0ff2fa3adb26

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/e155be94eb77b8209369b61281cd0ff2fa3adb26
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/tbb-commits/attachments/20240903/5221dd5d/attachment-0001.htm>


More information about the tbb-commits mailing list