Verified Commit 542b7313 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! BB 40925: Implemented the Security Level component

BB 43785: Fix DDG HTML in Safest.

During the rebases, we broke the automatic redirects to the HTML
version of DuckDuckGo. This commit fixes them.
parent 0fcb2e0f
Loading
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -359,18 +359,20 @@ export class EngineURL {
      lazy.SecurityLevelPrefs?.securityLevel === "safest" &&
      this.type === lazy.SearchUtils.URL_TYPE.SEARCH
    ) {
      let host = this.templateHost;
      let host = templateURI.host;
      try {
        host = Services.eTLD.getBaseDomainFromHost(host);
      } catch (ex) {
        lazy.logConsole.warn("Failed to get a FPD", ex, host);
      }
      if (
        host === "duckduckgo.com" ||
      if (host === "duckduckgo.com") {
        templateURI.host = "html.duckduckgo.com";
        templateURI.pathname = "/html";
      } else if (
        host ===
        "duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion"
      ) {
        query += "html";
        templateURI.pathname = "/html";
      }
    }