Commit 580652b9 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 a5c3e92c
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -5,6 +5,9 @@
  "ddg-html": [
  "ddg-html": [
    { "url": "chrome://global/content/search/duckduckgo.ico", "imageSize": 32 }
    { "url": "chrome://global/content/search/duckduckgo.ico", "imageSize": 32 }
  ],
  ],
  "ddg-noai": [
    { "url": "chrome://global/content/search/duckduckgo.ico", "imageSize": 32 }
  ],
  "mullvad-leta": [
  "mullvad-leta": [
    {
    {
      "url": "chrome://global/content/search/mullvad-leta.svg",
      "url": "chrome://global/content/search/mullvad-leta.svg",
+27 −0
Original line number Original line Diff line number Diff line
@@ -53,6 +53,24 @@
    "recordType": "engine",
    "recordType": "engine",
    "variants": [{ "environment": { "allRegionsAndLocales": true } }]
    "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": {
    "base": {
      "aliases": ["mojeek", "mj"],
      "aliases": ["mojeek", "mj"],
@@ -111,5 +129,14 @@
    "recordType": "defaultEngines",
    "recordType": "defaultEngines",
    "globalDefault": "mullvad-leta",
    "globalDefault": "mullvad-leta",
    "globalDefaultPrivate": "mullvad-leta"
    "globalDefaultPrivate": "mullvad-leta"
  },
  {
    "recordType": "engineOrders",
    "orders": [
      {
        "environment": { "allRegionsAndLocales": true },
        "order": ["ddg", "ddg-noai", "startpage"]
      }
    ]
  }
  }
]
]
+11 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,8 @@
/**
/**
 * This tests the SearchService to check our override of the remote settings is
 * This tests the SearchService to check our override of the remote settings is
 * working as expected.
 * working as expected.
 *
 * When adding new engines, it should be enough to change expectedURLs below.
 */
 */


"use strict";
"use strict";
@@ -12,6 +14,7 @@ const expectedURLs = {
  leta: "https://leta.mullvad.net/?q=test",
  leta: "https://leta.mullvad.net/?q=test",
  ddg: "https://duckduckgo.com/html/?q=test",
  ddg: "https://duckduckgo.com/html/?q=test",
  "ddg-html": "https://html.duckduckgo.com/html?q=test",
  "ddg-html": "https://html.duckduckgo.com/html?q=test",
  "ddg-noai": "https://noai.duckduckgo.com/?q=test",
  mojeek: "https://www.mojeek.com/search?q=test",
  mojeek: "https://www.mojeek.com/search?q=test",
  brave: "https://search.brave.com/search?q=test",
  brave: "https://search.brave.com/search?q=test",
  startpage: "https://www.startpage.com/sp/search?q=test",
  startpage: "https://www.startpage.com/sp/search?q=test",
@@ -49,3 +52,11 @@ add_task(function test_checkSearchURLs() {
    Assert.equal(foundUrl, url, `The URL of ${engine.name} is not altered.`);
    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();
  }
});