Commit 06ec60e5 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by brizental
Browse files

fixup! BB 43525: Skip Remote Settings for search engine customization.

MB 483: Ship DDG without AI as a bundled search engine.

MB 487: Use custom order for search engines.
parent 0d00ea76
Loading
Loading
Loading
Loading
+3 −0
Changes for toolkit/components/search/content/base-browser-search-engine-icons.json: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@
  "ddg": [
    { "url": "chrome://global/content/search/duckduckgo.ico", "imageSize": 32 }
  ],
  "ddg-noai": [
    { "url": "chrome://global/content/search/duckduckgo.ico", "imageSize": 32 }
  ],
  "ddg-onion": [
    { "url": "chrome://global/content/search/duckduckgo.ico", "imageSize": 32 }
  ],
+31 −0
Changes for toolkit/components/search/content/base-browser-search-engines.json: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,24 @@
    "recordType": "engine",
    "variants": [{ "environment": { "allRegionsAndLocales": true } }]
  },
  {
    "base": {
      "aliases": ["ddgnoai"],
      "classification": "general",
      "name": "DuckDuckGo (no AI)",
      "urls": {
        "search": {
          "base": "https://noai.duckduckgo.com/",
          "params": [],
          "searchTermParamName": "q"
        }
      }
    },
    "id": "91687f02-56dd-4fef-ba26-bf139dff3166",
    "identifier": "ddg-noai",
    "recordType": "engine",
    "variants": [{ "environment": { "allRegionsAndLocales": true } }]
  },
  {
    "base": {
      "aliases": ["ddgonion"],
@@ -93,5 +111,18 @@
    "recordType": "defaultEngines",
    "globalDefault": "ddg",
    "globalDefaultPrivate": "ddg"
  },
  {
    "recordType": "engineOrders",
    "orders": [
      {
        "environment": { "allRegionsAndLocales": true },
        "order": [
          "ddg",
          "ddg-noai",
          "startpage"
        ]
      }
    ]
  }
]
+11 −0
Changes for toolkit/components/search/tests/xpcshell/test_base_browser.js: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -4,12 +4,15 @@
/**
 * This tests the SearchService to check our override of the remote settings is
 * working as expected.
 *
 * When adding new engines, it should be enough to change expectedURLs below.
 */

"use strict";

const expectedURLs = {
  ddg: "https://duckduckgo.com/?q=test",
  "ddg-noai": "https://noai.duckduckgo.com/?q=test",
  "ddg-onion":
    "https://duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion/?q=test",
  startpage: "https://www.startpage.com/sp/search?q=test",
@@ -50,3 +53,11 @@ add_task(function test_checkSearchURLs() {
    Assert.equal(foundUrl, url, `The URL of ${engine.name} is not altered.`);
  }
});

add_task(async function test_iconsDoesNotFail() {
  for (const id of Object.keys(expectedURLs)) {
    const engine = Services.search.getEngineById(id);
    // No need to assert anything, as in case of error this method should throw.
    await engine.getIconURL();
  }
});