diff options
author | Amin Bandali <bandali@gnu.org> | 2021-10-11 18:15:11 -0400 |
---|---|---|
committer | Amin Bandali <bandali@gnu.org> | 2021-10-11 18:15:11 -0400 |
commit | 1537880dac3087d3779543303f0df83432831166 (patch) | |
tree | 1b07db784a06818e31e11da7b7867facb1222f4e | |
parent | 857afe0e546d0fb9bca6e2d2f79f0cbd44e6a5a3 (diff) |
Update GNU IceCat to 91.2.0
* data/files-to-append/browser/locales/en-US/browser/preferences/preferences.ftl
(detect-network-connectivity-option)
(detect-network-connectivity-description): Add label and description
for new IceCat-specific preference for toggling the network
connectivity service.
* data/newtab/directory.png:
* data/newtab/fsf.ico:
* data/newtab/fsf.png:
* data/newtab/gnu.ico:
* data/newtab/gnu.png:
* data/newtab/libreplanet.ico:
* data/newtab/libreplanet.png:
* data/newtab/trisquel.ico:
* data/newtab/trisquel.png:
* data/newtab/wikinews.ico:
* data/newtab/wikinews.png:
* data/newtab/wikipedia-org@2x.png:
* data/newtab/wikipedia.ico:
* data/newtab/wikipedia.png: New files, imported from Trisquel's
Abrowser build helper. These will be used for the "top sites"
displayed on the newtab page.
* data/patches/default-search-duckduckgo.patch:
* data/patches/duckduckgo-no-params.patch: Remove. The search engine
machinery has been completely changed upstream, yet again.
* data/patches/disable-settings-services.patch:
* data/patches/hide-protections-dashboard.patch:
* data/patches/icecat-about-dialog.patch:
* data/patches/moz-configure-changes.patch: Adapt to v91.
* data/patches/icecat-preferences.patch: Change the preference key for
the captive portal toggle from 'captivedetect.canonicalURL' to
'network.captive-portal-service.enabled'. There was at least one
report from several years back that
'network.captive-portal-service.enabled' was not respected:
https://bugzilla.mozilla.org/show_bug.cgi?id=1481085
But it seems to have been a rare occurrence/bug. As such, I believe
it's okay to toggle this preference instead of changing the address
'captivedetect.canonicalURL' points to.
* data/settings.js: Set several preferencess to try and disable new
annoying VPN- and mobile-related promos.
* makeicecat: Adapt to v91. Update FFMAJOR, FFMINOR,
SOURCEBALL_CHECKSUM, and L10N_CMP_REV. We now require Python 3 and
the jsonschema Python library as build dependencies. So check for
their existence and error out if they don't. Given that the search
engine machinery has been completely changed yet again, add a
'configure_search' function to make relevant changes, and ultimately
run the new 'tools/process-json-files.py' Python script. Also comment
out the 'configure_mobile', to be removed soon, as Mozilla has long
since removed the parts of the firefox code base for mobile builds,
and their mobile browser is now a separate project and code base.
* tools/process-json-files.py: New file, from packagers/maintainers of
Trisquel's Abrowser and Parabola's Iceweasel, for processing and
modifying various JSON files -- such as those relating to search
engines -- in the firefox code base.
25 files changed, 485 insertions, 1216 deletions
diff --git a/data/files-to-append/browser/locales/en-US/browser/preferences/preferences.ftl b/data/files-to-append/browser/locales/en-US/browser/preferences/preferences.ftl index 2f90bcd..87ce9b9 100644 --- a/data/files-to-append/browser/locales/en-US/browser/preferences/preferences.ftl +++ b/data/files-to-append/browser/locales/en-US/browser/preferences/preferences.ftl @@ -27,6 +27,10 @@ detect-captive-portal-option = .label = Detect captive portal detect-captive-portal-description = <a href=\"https://en.wikipedia.org/wiki/Captive_portal\">Captive portals</a> are the sites that control access to public wireless networks in hotels, airports, cafes, etc. The detection service is useful if you connect to such netwoks, but it will start connections automatically. +detect-network-connectivity-option = + .label = Detect network connectivity +detect-network-connectivity-description = The network connectivity service checks if IPv4/v6 DNS lookups work on the current network, whether connecting to IPv4/v6 addresses work on the current network, and whether a NAT64 gateway is detected on the network. These help the browser assess the network connectivity state, but will result in automatic DNS queries and HTTP connections being made for those checks. + geolocation-option = .label = Enable Geolocation geolocation-description = This is commonly used for maps, weather sites, and some stores. It is better to keep it off unless you really need it. diff --git a/data/newtab/directory.png b/data/newtab/directory.png Binary files differnew file mode 100644 index 0000000..4fbaacd --- /dev/null +++ b/data/newtab/directory.png diff --git a/data/newtab/fsf.ico b/data/newtab/fsf.ico Binary files differnew file mode 100644 index 0000000..1a616bd --- /dev/null +++ b/data/newtab/fsf.ico diff --git a/data/newtab/fsf.png b/data/newtab/fsf.png Binary files differnew file mode 100644 index 0000000..2ff8aff --- /dev/null +++ b/data/newtab/fsf.png diff --git a/data/newtab/gnu.ico b/data/newtab/gnu.ico Binary files differnew file mode 100644 index 0000000..3891a85 --- /dev/null +++ b/data/newtab/gnu.ico diff --git a/data/newtab/gnu.png b/data/newtab/gnu.png Binary files differnew file mode 100644 index 0000000..0669539 --- /dev/null +++ b/data/newtab/gnu.png diff --git a/data/newtab/libreplanet.ico b/data/newtab/libreplanet.ico Binary files differnew file mode 100644 index 0000000..c55e25e --- /dev/null +++ b/data/newtab/libreplanet.ico diff --git a/data/newtab/libreplanet.png b/data/newtab/libreplanet.png Binary files differnew file mode 100644 index 0000000..3b60e47 --- /dev/null +++ b/data/newtab/libreplanet.png diff --git a/data/newtab/trisquel.ico b/data/newtab/trisquel.ico Binary files differnew file mode 100644 index 0000000..0c0408c --- /dev/null +++ b/data/newtab/trisquel.ico diff --git a/data/newtab/trisquel.png b/data/newtab/trisquel.png Binary files differnew file mode 100644 index 0000000..3e5b00d --- /dev/null +++ b/data/newtab/trisquel.png diff --git a/data/newtab/wikinews.ico b/data/newtab/wikinews.ico Binary files differnew file mode 100644 index 0000000..6c7ce5a --- /dev/null +++ b/data/newtab/wikinews.ico diff --git a/data/newtab/wikinews.png b/data/newtab/wikinews.png Binary files differnew file mode 100644 index 0000000..93bde2c --- /dev/null +++ b/data/newtab/wikinews.png diff --git a/data/newtab/wikipedia-org@2x.png b/data/newtab/wikipedia-org@2x.png Binary files differnew file mode 100644 index 0000000..506aa1a --- /dev/null +++ b/data/newtab/wikipedia-org@2x.png diff --git a/data/newtab/wikipedia.ico b/data/newtab/wikipedia.ico Binary files differnew file mode 100644 index 0000000..e700218 --- /dev/null +++ b/data/newtab/wikipedia.ico diff --git a/data/newtab/wikipedia.png b/data/newtab/wikipedia.png Binary files differnew file mode 100644 index 0000000..506aa1a --- /dev/null +++ b/data/newtab/wikipedia.png diff --git a/data/patches/default-search-duckduckgo.patch b/data/patches/default-search-duckduckgo.patch deleted file mode 100644 index 93c70c6..0000000 --- a/data/patches/default-search-duckduckgo.patch +++ /dev/null @@ -1,1092 +0,0 @@ ---- a/browser/components/search/SearchTelemetry.jsm -+++ b/browser/components/search/SearchTelemetry.jsm -@@ -61,16 +61,6 @@ - * a partner search. - */ - const SEARCH_PROVIDER_INFO = { -- google: { -- regexp: /^https:\/\/www\.google\.(?:.+)\/search/, -- queryParam: "q", -- codeParam: "client", -- codePrefixes: ["firefox"], -- followonParams: ["oq", "ved", "ei"], -- extraAdServersRegexps: [ -- /^https:\/\/www\.google(?:adservices)?\.com\/(?:pagead\/)?aclk/, -- ], -- }, - duckduckgo: { - regexp: /^https:\/\/duckduckgo\.com\//, - queryParam: "q", -@@ -81,6 +71,16 @@ - /^https:\/\/www\.amazon\.(?:[a-z.]{2,24}).*(?:tag=duckduckgo-)/, - ], - }, -+ google: { -+ regexp: /^https:\/\/www\.google\.(?:.+)\/search/, -+ queryParam: "q", -+ codeParam: "client", -+ codePrefixes: ["firefox"], -+ followonParams: ["oq", "ved", "ei"], -+ extraAdServersRegexps: [ -+ /^https:\/\/www\.google(?:adservices)?\.com\/(?:pagead\/)?aclk/, -+ ], -+ }, - yahoo: { - regexp: /^https:\/\/(?:.*)search\.yahoo\.com\/search/, - queryParam: "p", ---- a/browser/components/search/extensions/list.json -+++ b/browser/components/search/extensions/list.json -@@ -1,9 +1,9 @@ - { - "default": { -- "searchDefault": "Google", -- "searchOrder": ["Google", "Bing"], -+ "searchDefault": "DuckDuckGo", -+ "searchOrder": ["DuckDuckGo", "Google", "Bing"], - "visibleDefaultEngines": [ -- "google-b-d", "amazondotcom", "bing", "ddg", "ebay", "wikipedia" -+ "ddg", "google-b-d", "amazondotcom", "bing", "ebay", "wikipedia" - ] - }, - "regionOverrides": { -@@ -54,32 +54,32 @@ - "en-US": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazondotcom", "bing", "ddg", "ebay", "wikipedia" -+ "ddg", "google-b-d", "amazondotcom", "bing", "ebay", "wikipedia" - ] - }, - "KZ": { - "visibleDefaultEngines": [ -- "amazondotcom", "bing", "google-b-d", "wikipedia", "ddg", "yandex-en" -+ "ddg", "amazondotcom", "bing", "google-b-d", "wikipedia", "yandex-en" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "BY": { - "visibleDefaultEngines": [ -- "amazondotcom", "bing", "google-b-d", "wikipedia", "ddg", "yandex-en" -+ "ddg", "amazondotcom", "bing", "google-b-d", "wikipedia", "yandex-en" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "RU": { - "visibleDefaultEngines": [ -- "amazondotcom", "bing", "google-b-d", "wikipedia", "ddg", "yandex-en" -+ "ddg", "amazondotcom", "bing", "google-b-d", "wikipedia", "yandex-en" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "TR": { - "visibleDefaultEngines": [ -- "amazondotcom", "bing", "google-b-d", "wikipedia", "ddg", "yandex-en" -+ "ddg", "amazondotcom", "bing", "google-b-d", "wikipedia", "yandex-en" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "experimental-hidden": { - "visibleDefaultEngines": [ -@@ -90,145 +90,145 @@ - "ach": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia" - ] - } - }, - "af": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-af" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-af" - ] - } - }, - "an": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ebay-es", "wikipedia-an", "ddg" -+ "ddg", "google-b-d", "bing", "ebay-es", "wikipedia-an" - ] - } - }, - "ar": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-ar" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-ar" - ] - } - }, - "ast": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "ebay-es", "wikipedia-ast" -+ "ddg", "google-b-d", "bing", "ebay-es", "wikipedia-ast" - ] - } - }, - "az": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazondotcom", "azerdict", "bing", "ddg", "wikipedia-az", "yandex-az" -+ "ddg", "google-b-d", "amazondotcom", "azerdict", "bing", "wikipedia-az", "yandex-az" - ] - } - }, - "be": { - "default": { - "visibleDefaultEngines": [ -- "yandex-by", "google-b-d", "ddg", "wikipedia-be", "wikipedia-be-tarask" -+ "ddg", "yandex-by", "google-b-d", "wikipedia-be", "wikipedia-be-tarask" - ] - }, - "BY": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - }, - "KZ": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - }, - "RU": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - }, - "TR": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - } - }, - "bg": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazondotcom", "ddg", "pazaruvaj", "wikipedia-bg" -+ "ddg", "google-b-d", "amazondotcom", "pazaruvaj", "wikipedia-bg" - ] - } - }, - "bn": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-in", "bing", "ddg", "wikipedia-bn" -+ "ddg", "google-b-d", "amazon-in", "bing", "wikipedia-bn" - ] - } - }, - "bn-BD": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "wikipedia-bn" -+ "ddg", "google-b-d", "bing", "wikipedia-bn" - ] - } - }, - "bn-IN": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-in", "bing", "ddg", "wikipedia-bn" -+ "ddg", "google-b-d", "amazon-in", "bing", "wikipedia-bn" - ] - } - }, - "bo": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "wikipedia" -+ "ddg", "google-b-d", "wikipedia" - ] - } - }, - "br": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-france", "ddg", "ebay-fr", "freelang", "wikipedia-br" -+ "ddg", "google-b-d", "amazon-france", "ebay-fr", "freelang", "wikipedia-br" - ] - } - }, - "brx": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "wikipedia" -+ "ddg", "google-b-d", "wikipedia" - ] - } - }, - "bs": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "olx", "wikipedia-bs" -+ "ddg", "google-b-d", "olx", "wikipedia-bs" - ] - } - }, - "ca": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "diec2", "ddg", "ebay-es", "wikipedia-ca" -+ "ddg", "google-b-d", "bing", "diec2", "ebay-es", "wikipedia-ca" - ] - } - }, - "ca-valencia": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "diec2", "ddg", "ebay-es", "wikipedia-ca" -+ "ddg", "google-b-d", "bing", "diec2", "ebay-es", "wikipedia-ca" - ] - } - }, - "cak": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-es" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-es" - ] - } - }, - "ckb": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "wikipedia" -+ "ddg", "google-b-d", "wikipedia" - ] - } - }, -@@ -236,74 +236,74 @@ - "default": { - "searchOrder": ["Google", "Seznam"], - "visibleDefaultEngines": [ -- "google-b-d", "seznam-cz", "ddg", "heureka-cz", "mapy-cz", "wikipedia-cz" -+ "ddg", "google-b-d", "seznam-cz", "heureka-cz", "mapy-cz", "wikipedia-cz" - ] - } - }, - "cy": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-en-GB", "ddg", "ebay-uk", "palasprint", "wikipedia-cy" -+ "ddg", "google-b-d", "amazon-en-GB", "ebay-uk", "palasprint", "wikipedia-cy" - ] - } - }, - "da": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-en-GB", "ddg", "wikipedia-da" -+ "ddg", "google-b-d", "bing", "amazon-en-GB", "wikipedia-da" - ] - } - }, - "de": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-de", "bing", "ddg", "ebay-de", "ecosia", "leo_ende_de", "wikipedia-de" -+ "ddg", "google-b-d", "amazon-de", "bing", "ebay-de", "ecosia", "leo_ende_de", "wikipedia-de" - ] - } - }, - "dsb": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-de", "ddg", "ebay-de", "leo_ende_de", "wikipedia-dsb" -+ "ddg", "google-b-d", "bing", "amazon-de", "ebay-de", "leo_ende_de", "wikipedia-dsb" - ] - } - }, - "el": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-en-GB", "bing", "ddg", "wikipedia-el" -+ "ddg", "google-b-d", "amazon-en-GB", "bing", "wikipedia-el" - ] - } - }, - "en-CA": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "wikipedia" -+ "ddg", "google-b-d", "amazon-ca", "bing", "ebay-ca", "wikipedia" - ] - }, - "KZ": { - "visibleDefaultEngines": [ -- "yandex-en", "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "wikipedia" -+ "ddg", "yandex-en", "google-b-d", "amazon-ca", "bing", "ebay-ca", "wikipedia" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "BY": { - "visibleDefaultEngines": [ -- "yandex-en", "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "wikipedia" -+ "ddg", "yandex-en", "google-b-d", "amazon-ca", "bing", "ebay-ca", "wikipedia" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "RU": { - "visibleDefaultEngines": [ -- "yandex-en", "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "wikipedia" -+ "ddg", "yandex-en", "google-b-d", "amazon-ca", "bing", "ebay-ca", "wikipedia" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "TR": { - "visibleDefaultEngines": [ -- "yandex-en", "google-b-d", "amazon-ca", "bing", "ddg", "ebay-ca", "wikipedia" -+ "ddg", "yandex-en", "google-b-d", "amazon-ca", "bing", "ebay-ca", "wikipedia" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "experimental-hidden": { - "visibleDefaultEngines": [ -@@ -314,32 +314,32 @@ - "en-GB": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "wikipedia" -+ "ddg", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ebay-uk", "wikipedia" - ] - }, - "KZ": { - "visibleDefaultEngines": [ -- "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "wikipedia" -+ "ddg", "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ebay-uk", "wikipedia" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "BY": { - "visibleDefaultEngines": [ -- "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "wikipedia" -+ "ddg", "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ebay-uk", "wikipedia" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "RU": { - "visibleDefaultEngines": [ -- "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "wikipedia" -+ "ddg", "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ebay-uk", "wikipedia" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "TR": { - "visibleDefaultEngines": [ -- "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ddg", "ebay-uk", "wikipedia" -+ "ddg", "yandex-en", "google-b-d", "bing", "amazon-en-GB", "chambers-en-GB", "ebay-uk", "wikipedia" - ], -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "experimental-hidden": { - "visibleDefaultEngines": [ -@@ -350,35 +350,35 @@ - "eo": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-eo" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-eo" - ] - } - }, - "es-AR": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazondotcom", "drae", "ddg", "mercadolibre-ar", "wikipedia-es" -+ "ddg", "google-b-d", "amazondotcom", "drae", "mercadolibre-ar", "wikipedia-es" - ] - } - }, - "es-CL": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "drae", "ddg", "mercadolibre-cl", "wikipedia-es" -+ "ddg", "google-b-d", "bing", "drae", "mercadolibre-cl", "wikipedia-es" - ] - } - }, - "es-ES": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "drae", "ddg", "ebay-es", "wikipedia-es" -+ "ddg", "google-b-d", "bing", "drae", "ebay-es", "wikipedia-es" - ] - } - }, - "es-MX": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "mercadolibre-mx", "wikipedia-es" -+ "ddg", "google-b-d", "bing", "mercadolibre-mx", "wikipedia-es" - ] - }, - "experimental-hidden": { -@@ -390,49 +390,49 @@ - "et": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "neti-ee", "ddg", "osta-ee", "wikipedia-et", "eki-ee" -+ "ddg", "google-b-d", "neti-ee", "osta-ee", "wikipedia-et", "eki-ee" - ] - } - }, - "eu": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-en-GB", "ddg", "ebay-es", "wikipedia-eu" -+ "ddg", "google-b-d", "bing", "amazon-en-GB", "ebay-es", "wikipedia-eu" - ] - } - }, - "fa": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazondotcom", "bing", "ddg", "wikipedia-fa" -+ "ddg", "google-b-d", "amazondotcom", "bing", "wikipedia-fa" - ] - } - }, - "ff": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-france", "ddg", "wikipedia-fr" -+ "ddg", "google-b-d", "bing", "amazon-france", "wikipedia-fr" - ] - } - }, - "fi": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "wikipedia-fi" -+ "ddg", "google-b-d", "bing", "wikipedia-fi" - ] - } - }, - "fr": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-france", "ddg", "ebay-fr", "qwant", "wikipedia-fr" -+ "ddg", "google-b-d", "bing", "amazon-france", "ebay-fr", "qwant", "wikipedia-fr" - ] - } - }, - "fy-NL": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "bolcom-fy-NL", "ddg", "ebay-nl", "marktplaats-fy-NL", "wikipedia-fy-NL" -+ "ddg", "google-b-d", "bing", "bolcom-fy-NL", "ebay-nl", "marktplaats-fy-NL", "wikipedia-fy-NL" - ] - }, - "experimental-hidden": { -@@ -444,112 +444,112 @@ - "ga-IE": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-en-GB", "ddg", "ebay-ie", "tearma", "wikipedia-ga-IE" -+ "ddg", "google-b-d", "amazon-en-GB", "ebay-ie", "tearma", "wikipedia-ga-IE" - ] - } - }, - "gd": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-en-GB", "bbc-alba", "ddg", "ebay-uk", "faclair-beag", "wikipedia-gd" -+ "ddg", "google-b-d", "amazon-en-GB", "bbc-alba", "ebay-uk", "faclair-beag", "wikipedia-gd" - ] - } - }, - "gl": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-en-GB", "ddg", "ebay-es", "wikipedia-gl" -+ "ddg", "google-b-d", "amazon-en-GB", "ebay-es", "wikipedia-gl" - ] - } - }, - "gn": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-gn" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-gn" - ] - } - }, - "gu-IN": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-in", "ddg", "wikipedia-gu" -+ "ddg", "google-b-d", "bing", "amazon-in", "wikipedia-gu" - ] - } - }, - "he": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "wikipedia-he", "morfix-dic" -+ "ddg", "google-b-d", "wikipedia-he", "morfix-dic" - ] - } - }, - "hi-IN": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "wikipedia-hi" -+ "ddg", "google-b-d", "bing", "wikipedia-hi" - ] - } - }, - "hr": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-en-GB", "bing", "ddg", "eudict", "wikipedia-hr" -+ "ddg", "google-b-d", "amazon-en-GB", "bing", "eudict", "wikipedia-hr" - ] - } - }, - "hsb": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-de", "ddg", "ebay-de", "leo_ende_de", "wikipedia-hsb" -+ "ddg", "google-b-d", "bing", "amazon-de", "ebay-de", "leo_ende_de", "wikipedia-hsb" - ] - } - }, - "hu": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "vatera", "wikipedia-hu" -+ "ddg", "google-b-d", "vatera", "wikipedia-hu" - ] - } - }, - "hye": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "wikipedia" -+ "ddg", "google-b-d", "wikipedia" - ] - } - }, - "hy-AM": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazondotcom", "ddg", "list-am", "wikipedia-hy" -+ "ddg", "google-b-d", "amazondotcom", "list-am", "wikipedia-hy" - ] - } - }, - "ia": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-ia" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-ia" - ] - } - }, - "id": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "wikipedia-id" -+ "ddg", "google-b-d", "wikipedia-id" - ] - } - }, - "is": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-is" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-is" - ] - } - }, - "it": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-it", "ddg", "ebay-it", "wikipedia-it" -+ "ddg", "google-b-d", "bing", "amazon-it", "ebay-it", "wikipedia-it" - ] - } - }, -@@ -557,7 +557,7 @@ - "default": { - "searchOrder": ["Google", "Yahoo! JAPAN", "Bing", "Amazon.co.jp", "楽天市場", "ヤフオク!", "教えて!goo", "Wikipedia (ja)"], - "visibleDefaultEngines": [ -- "google-b-d", "yahoo-jp", "bing", "amazon-jp", "rakuten", "yahoo-jp-auctions", "oshiete-goo", "wikipedia-ja", "ddg" -+ "ddg", "google-b-d", "yahoo-jp", "bing", "amazon-jp", "rakuten", "yahoo-jp-auctions", "oshiete-goo", "wikipedia-ja" - ] - } - }, -@@ -565,152 +565,152 @@ - "default": { - "searchOrder": ["Google", "Yahoo! JAPAN", "Bing", "Amazon.co.jp", "楽天市場", "ヤフオク!", "教えて!goo", "Wikipedia (ja)"], - "visibleDefaultEngines": [ -- "google-b-d", "yahoo-jp", "bing", "amazon-jp", "rakuten", "yahoo-jp-auctions", "oshiete-goo", "wikipedia-ja", "ddg" -+ "ddg", "google-b-d", "yahoo-jp", "bing", "amazon-jp", "rakuten", "yahoo-jp-auctions", "oshiete-goo", "wikipedia-ja" - ] - } - }, - "ka": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-ka" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-ka" - ] - } - }, - "kab": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "wikipedia-kab" -+ "ddg", "google-b-d", "bing", "wikipedia-kab" - ] - } - }, - "kk": { - "default": { - "visibleDefaultEngines": [ -- "yandex-kk", "google-b-d", "ddg", "flip", "wikipedia-kk" -+ "ddg", "yandex-kk", "google-b-d", "flip", "wikipedia-kk" - ] - }, - "KZ": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - }, - "BY": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - }, - "RU": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - }, - "TR": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - } - }, - "km": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-km" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-km" - ] - } - }, - "kn": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-in", "ddg", "kannadastore", "wikipedia-kn" -+ "ddg", "google-b-d", "bing", "amazon-in", "kannadastore", "wikipedia-kn" - ] - } - }, - "ko": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "naver-kr", "daum-kr", "wikipedia-kr" -+ "ddg", "google-b-d", "naver-kr", "daum-kr", "wikipedia-kr" - ] - } - }, - "lij": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-it", "ddg", "ebay-it", "wikipedia-lij" -+ "ddg", "google-b-d", "bing", "amazon-it", "ebay-it", "wikipedia-lij" - ] - } - }, - "lo": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "wikipedia-lo" -+ "ddg", "google-b-d", "bing", "wikipedia-lo" - ] - } - }, - "lt": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "wikipedia-lt", "bing", "amazondotcom", "ddg" -+ "ddg", "google-b-d", "wikipedia-lt", "bing", "amazondotcom" - ] - } - }, - "ltg": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "salidzinilv", "sslv", "wikipedia-ltg" -+ "ddg", "google-b-d", "salidzinilv", "sslv", "wikipedia-ltg" - ] - } - }, - "lv": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "salidzinilv", "sslv", "wikipedia-lv" -+ "ddg", "google-b-d", "salidzinilv", "sslv", "wikipedia-lv" - ] - } - }, - "meh": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "wikipedia" -+ "ddg", "google-b-d", "wikipedia" - ] - } - }, - "mk": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-mk" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-mk" - ] - } - }, - "mr": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-in", "ddg", "wikipedia-mr" -+ "ddg", "google-b-d", "amazon-in", "wikipedia-mr" - ] - } - }, - "ms": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-ms" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-ms" - ] - } - }, - "my": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-my" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-my" - ] - } - }, - "nb-NO": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-en-GB", "bing", "ddg", "gulesider-NO", "bok-NO", "qxl-NO", "wikipedia-NO" -+ "ddg", "google-b-d", "amazon-en-GB", "bing", "gulesider-NO", "bok-NO", "qxl-NO", "wikipedia-NO" - ] - } - }, - "ne-NP": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "wikipedia-ne" -+ "ddg", "google-b-d", "bing", "wikipedia-ne" - ] - } - }, - "nl": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "bolcom-nl", "ddg", "ebay-nl", "marktplaats-nl", "wikipedia-nl" -+ "ddg", "google-b-d", "bing", "bolcom-nl", "ebay-nl", "marktplaats-nl", "wikipedia-nl" - ] - }, - "experimental-hidden": { -@@ -722,244 +722,244 @@ - "nn-NO": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-en-GB", "ddg", "gulesider-NO", "bok-NO", "qxl-NO", "wikipedia-NN" -+ "ddg", "google-b-d", "bing", "amazon-en-GB", "gulesider-NO", "bok-NO", "qxl-NO", "wikipedia-NN" - ] - } - }, - "oc": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "wikipedia-oc", "wiktionary-oc" -+ "ddg", "google-b-d", "bing", "wikipedia-oc", "wiktionary-oc" - ] - } - }, - "pa-IN": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-in", "ddg", "wikipedia-pa" -+ "ddg", "google-b-d", "bing", "amazon-in", "wikipedia-pa" - ] - } - }, - "pl": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "allegro-pl", "ddg", "pwn-pl", "wikipedia-pl", "wolnelektury-pl" -+ "ddg", "google-b-d", "allegro-pl", "pwn-pl", "wikipedia-pl", "wolnelektury-pl" - ] - } - }, - "pt-BR": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "mercadolivre", "wikipedia-pt" -+ "ddg", "google-b-d", "bing", "mercadolivre", "wikipedia-pt" - ] - } - }, - "pt-PT": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-en-GB", "ddg", "priberam", "wikipedia-pt" -+ "ddg", "google-b-d", "amazon-en-GB", "priberam", "wikipedia-pt" - ] - } - }, - "rm": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "ebay-ch", "leo_ende_de", "wikipedia-rm" -+ "ddg", "google-b-d", "bing", "ebay-ch", "leo_ende_de", "wikipedia-rm" - ] - } - }, - "ro": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-ro" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-ro" - ] - } - }, - "ru": { - "default": { - "visibleDefaultEngines": [ -- "yandex-ru", "google-b-d", "ddg", "ozonru", "priceru", "wikipedia-ru", "mailru" -+ "ddg", "yandex-ru", "google-b-d", "ozonru", "priceru", "wikipedia-ru", "mailru" - ] - }, - "RU": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - }, - "BY": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - }, - "KZ": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - }, - "TR": { -- "searchDefault": "Яндекс" -+ "searchDefault": "DuckDuckGo" - } - }, - "scn": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "wikipedia" -+ "ddg", "google-b-d", "wikipedia" - ] - } - }, - "si": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazondotcom", "ddg", "wikipedia-si" -+ "ddg", "google-b-d", "amazondotcom", "wikipedia-si" - ] - } - }, - "sk": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "azet-sk", "atlas-sk", "ddg", "wikipedia-sk", "zoznam-sk" -+ "ddg", "google-b-d", "azet-sk", "atlas-sk", "wikipedia-sk", "zoznam-sk" - ] - } - }, - "sl": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ceneji", "ddg", "najdi-si", "odpiralni", "wikipedia-sl" -+ "ddg", "google-b-d", "ceneji", "najdi-si", "odpiralni", "wikipedia-sl" - ] - } - }, - "son": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-france", "ddg", "wikipedia-fr" -+ "ddg", "google-b-d", "bing", "amazon-france", "wikipedia-fr" - ] - } - }, - "sq": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-en-GB", "ddg", "wikipedia-sq" -+ "ddg", "google-b-d", "bing", "amazon-en-GB", "wikipedia-sq" - ] - } - }, - "sr": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-en-GB", "bing", "ddg", "wikipedia-sr", "pogodak" -+ "ddg", "google-b-d", "amazon-en-GB", "bing", "wikipedia-sr", "pogodak" - ] - } - }, - "sv-SE": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "allaannonser-sv-SE", "ddg", "prisjakt-sv-SE", "tyda-sv-SE", "wikipedia-sv-SE" -+ "ddg", "google-b-d", "bing", "allaannonser-sv-SE", "prisjakt-sv-SE", "tyda-sv-SE", "wikipedia-sv-SE" - ] - } - }, - "ta": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-in", "ddg", "wikipedia-ta" -+ "ddg", "google-b-d", "amazon-in", "wikipedia-ta" - ] - } - }, - "te": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazon-in", "ddg", "wikipedia-te", "wiktionary-te" -+ "ddg", "google-b-d", "amazon-in", "wikipedia-te", "wiktionary-te" - ] - } - }, - "th": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "amazondotcom", "bing", "ddg", "longdo", "wikipedia-th" -+ "ddg", "google-b-d", "amazondotcom", "bing", "longdo", "wikipedia-th" - ] - } - }, - "tl": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-tl" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-tl" - ] - } - }, - "tr": { - "default": { - "visibleDefaultEngines": [ -- "yandex-tr", "google-b-d", "ddg", "wikipedia-tr" -+ "ddg", "yandex-tr", "google-b-d", "wikipedia-tr" - ] - }, - "TR": { -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "BY": { -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "KZ": { -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - }, - "RU": { -- "searchDefault": "Yandex" -+ "searchDefault": "DuckDuckGo" - } - }, - "trs": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-es" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-es" - ] - } - }, - "uk": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "wikipedia-uk", "hotline-ua" -+ "ddg", "google-b-d", "bing", "wikipedia-uk", "hotline-ua" - ] - } - }, - "ur": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-in", "ddg", "wikipedia-ur" -+ "ddg", "google-b-d", "bing", "amazon-in", "wikipedia-ur" - ] - } - }, - "uz": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazondotcom", "ddg", "wikipedia-uz" -+ "ddg", "google-b-d", "bing", "amazondotcom", "wikipedia-uz" - ] - } - }, - "vi": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "coccoc", "ddg", "wikipedia-vi" -+ "ddg", "google-b-d", "coccoc", "wikipedia-vi" - ] - } - }, - "wo": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "amazon-france", "ddg", "ebay-fr", "wikipedia-wo" -+ "ddg", "google-b-d", "bing", "amazon-france", "ebay-fr", "wikipedia-wo" - ] - } - }, - "xh": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "bing", "ddg", "wikipedia" -+ "ddg", "google-b-d", "bing", "wikipedia" - ] - } - }, - "zh-CN": { - "default": { - "visibleDefaultEngines": [ -- "baidu", "google-b-d", "bing", "ddg", "wikipedia-zh-CN", "amazondotcn" -+ "ddg", "baidu", "google-b-d", "bing", "wikipedia-zh-CN", "amazondotcn" - ] - }, - "CN": { -- "searchDefault": "百度" -+ "searchDefault": "DuckDuckGo" - } - }, - "zh-TW": { - "default": { - "visibleDefaultEngines": [ -- "google-b-d", "ddg", "readmoo", "wikipedia-zh-TW" -+ "ddg", "google-b-d", "readmoo", "wikipedia-zh-TW" - ] - } - } diff --git a/data/patches/disable-settings-services.patch b/data/patches/disable-settings-services.patch index d869bff..a79d0e4 100644 --- a/data/patches/disable-settings-services.patch +++ b/data/patches/disable-settings-services.patch @@ -1,13 +1,16 @@ ---- a/services/settings/Utils.jsm -+++ b/services/settings/Utils.jsm -@@ -59,9 +59,7 @@ - Ci.nsIEnvironment +--- a/services/settings/Utils.jsm.orig 2021-08-17 16:32:27.475448626 -0400 ++++ b/services/settings/Utils.jsm 2021-08-17 16:32:40.859457980 -0400 +@@ -60,12 +60,7 @@ ); const isXpcshell = env.exists("XPCSHELL_TEST_PROFILE_DIR"); -- return AppConstants.RELEASE_OR_BETA && !Cu.isInAutomation && !isXpcshell + const isNotThunderbird = AppConstants.MOZ_APP_NAME != "thunderbird"; +- return AppConstants.RELEASE_OR_BETA && +- !Cu.isInAutomation && +- !isXpcshell && +- isNotThunderbird - ? "https://firefox.settings.services.mozilla.com/v1" - : gServerURL; + return gServerURL; }, - CHANGES_PATH: "/buckets/monitor/collections/changes/records", + CHANGES_PATH: "/buckets/monitor/collections/changes/changeset", diff --git a/data/patches/duckduckgo-no-params.patch b/data/patches/duckduckgo-no-params.patch deleted file mode 100644 index fe28e59..0000000 --- a/data/patches/duckduckgo-no-params.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- a/browser/components/search/extensions/ddg/manifest.json -+++ b/browser/components/search/extensions/ddg/manifest.json -@@ -18,43 +18,11 @@ - "chrome_settings_overrides": { - "search_provider": { - "name": "DuckDuckGo", -- "search_url": "https://duckduckgo.com/", -- "search_form": "https://duckduckgo.com/?q={searchTerms}", -- "search_url_get_params": "q={searchTerms}", -- "params": [ -- { -- "name": "t", -- "condition": "purpose", -- "purpose": "contextmenu", -- "value": "ffcm" -- }, -- { -- "name": "t", -- "condition": "purpose", -- "purpose": "keyword", -- "value": "ffab" -- }, -- { -- "name": "t", -- "condition": "purpose", -- "purpose": "searchbar", -- "value": "ffsb" -- }, -- { -- "name": "t", -- "condition": "purpose", -- "purpose": "homepage", -- "value": "ffhp" -- }, -- { -- "name": "t", -- "condition": "purpose", -- "purpose": "newtab", -- "value": "ffnt" -- } -- ], -+ "search_url": "https://duckduckgo.com", -+ "search_form": "https://duckduckgo.com", -+ "search_url_post_params": "q={searchTerms}", - "suggest_url": "https://ac.duckduckgo.com/ac/", - "suggest_url_get_params": "q={searchTerms}&type=list" - } - } --} -\ No newline at end of file -+} diff --git a/data/patches/hide-protections-dashboard.patch b/data/patches/hide-protections-dashboard.patch index 9fd6d4c..d1eb999 100644 --- a/data/patches/hide-protections-dashboard.patch +++ b/data/patches/hide-protections-dashboard.patch @@ -1,26 +1,26 @@ ---- a/browser/components/customizableui/content/panelUI.inc.xhtml -+++ b/browser/components/customizableui/content/panelUI.inc.xhtml -@@ -242,7 +242,7 @@ - oncommand="gSync.toggleAccountPanel('PanelUI-fxa', this, event)"/> - </toolbaritem> - <toolbarseparator class="sync-ui-item"/> -- <toolbaritem> -+ <toolbaritem hidden="true"> - <toolbarbutton id="appMenu-protection-report-button" - class="subviewbutton subviewbutton-iconic" - oncommand="gProtectionsHandler.openProtections(); gProtectionsHandler.recordClick('open_full_report', null, 'app_menu');"> -@@ -253,7 +253,7 @@ - </label> - </toolbarbutton> - </toolbaritem> -- <toolbarseparator id="appMenu-tp-separator"/> -+ <toolbarseparator id="appMenu-tp-separator" hidden="true"/> - <toolbarbutton id="appMenu-new-window-button" - class="subviewbutton subviewbutton-iconic" - label="&newNavigatorCmd.label;" ---- a/browser/base/content/browser-siteProtections.js -+++ b/browser/base/content/browser-siteProtections.js -@@ -1634,7 +1634,7 @@ +--- a/browser/base/content/appmenu-viewcache.inc.xhtml.orig 2021-08-17 16:54:44.323100518 -0400 ++++ b/browser/base/content/appmenu-viewcache.inc.xhtml 2021-08-17 16:55:42.131053772 -0400 +@@ -24,7 +24,7 @@ + oncommand="gSync.toggleAccountPanel(this, event)"/> + </toolbaritem> + <toolbarseparator class="sync-ui-item"/> +- <toolbaritem> ++ <toolbaritem hidden="true"> + <toolbarbutton id="appMenu-protection-report-button" + class="subviewbutton subviewbutton-iconic" + oncommand="gProtectionsHandler.openProtections(); gProtectionsHandler.recordClick('open_full_report', null, 'app_menu');"> +@@ -35,7 +35,7 @@ + </label> + </toolbarbutton> + </toolbaritem> +- <toolbarseparator id="appMenu-tp-separator"/> ++ <toolbarseparator id="appMenu-tp-separator" hidden="true"/> + <toolbarbutton id="appMenu-new-window-button" + class="subviewbutton subviewbutton-iconic" + data-l10n-id="appmenuitem-new-window" +--- a/browser/base/content/browser-siteProtections.js.orig 2021-08-17 16:52:32.107227395 -0400 ++++ b/browser/base/content/browser-siteProtections.js 2021-08-17 16:52:39.303219686 -0400 +@@ -1558,7 +1558,7 @@ this._trackingProtectionIconContainer.hidden = true; return; } @@ -28,4 +28,4 @@ + this._trackingProtectionIconContainer.hidden = true; // Check whether the user has added an exception for this site. - let hasException = ContentBlockingAllowList.includes( + this.hasException = ContentBlockingAllowList.includes( diff --git a/data/patches/icecat-about-dialog.patch b/data/patches/icecat-about-dialog.patch index 476fb18..0551cf7 100644 --- a/data/patches/icecat-about-dialog.patch +++ b/data/patches/icecat-about-dialog.patch @@ -1,10 +1,10 @@ ---- a/browser/base/content/aboutDialog.xhtml -+++ b/browser/base/content/aboutDialog.xhtml -@@ -147,7 +147,6 @@ +--- a/browser/base/content/aboutDialog.xhtml.orig 2021-08-17 16:59:51.674898001 -0400 ++++ b/browser/base/content/aboutDialog.xhtml 2021-08-17 17:00:18.346884904 -0400 +@@ -161,7 +161,6 @@ <hbox pack="center"> - <label is="text-link" class="bottom-link" useoriginprincipal="true" href="about:license" data-l10n-id="bottomLinks-license"></label> - <label is="text-link" class="bottom-link" useoriginprincipal="true" href="about:rights" data-l10n-id="bottomLinks-rights"></label> -- <label is="text-link" class="bottom-link" href="https://www.mozilla.org/privacy/" data-l10n-id="bottomLinks-privacy"></label> + <label is="text-link" class="bottom-link" useoriginprincipal="true" href="about:license" data-l10n-id="bottomLinks-license"/> + <label is="text-link" class="bottom-link" useoriginprincipal="true" href="about:rights" data-l10n-id="bottomLinks-rights"/> +- <label is="text-link" class="bottom-link" href="https://www.mozilla.org/privacy/?utm_source=firefox-browser&utm_medium=firefox-desktop&utm_campaign=about-dialog" data-l10n-id="bottomLinks-privacy"/> </hbox> <description id="trademark" data-l10n-id="trademarkInfo"></description> </vbox> diff --git a/data/patches/icecat-preferences.patch b/data/patches/icecat-preferences.patch index 57d3c5a..46bfa8b 100644 --- a/data/patches/icecat-preferences.patch +++ b/data/patches/icecat-preferences.patch @@ -1,6 +1,6 @@ ---- a/browser/components/preferences/privacy.inc.xhtml.orig 2020-09-06 22:53:37.160379447 -0400 -+++ b/browser/components/preferences/privacy.inc.xhtml 2020-09-06 22:45:17.436948014 -0400 -@@ -602,6 +602,70 @@ +--- a/browser/components/preferences/privacy.inc.xhtml.orig 2021-08-17 15:38:19.838881866 -0400 ++++ b/browser/components/preferences/privacy.inc.xhtml 2021-08-17 15:39:01.382760058 -0400 +@@ -632,6 +632,76 @@ data-l10n-id="addressbar-suggestions-settings"/> </groupbox> @@ -46,12 +46,19 @@ + </vbox> + <vbox> + <checkbox id="detectCaptivePortal" data-l10n-id="detect-captive-portal-option" -+ preference="captivedetect.canonicalURL"/> ++ preference="network.captive-portal-service.enabled"/> + <vbox class="indent"> + <label data-l10n-id="detect-captive-portal-description"/> + </vbox> + </vbox> + <vbox> ++ <checkbox id="detectNetworkConnectivity" data-l10n-id="detect-network-connectivity-option" ++ preference="network.connectivity-service.enabled"/> ++ <vbox class="indent"> ++ <label data-l10n-id="detect-network-connectivity-description"/> ++ </vbox> ++ </vbox> ++ <vbox> + <checkbox id="geolocation" data-l10n-id="geolocation-option" + preference="browser.search.geoip.url"/> + <vbox class="indent"> @@ -67,15 +74,14 @@ + </vbox> +</groupbox> + -+ <hbox id="permissionsCategory" class="subcategory" hidden="true" ---- a/browser/components/preferences/privacy.js.orig 2020-09-06 22:53:44.008371642 -0400 -+++ b/browser/components/preferences/privacy.js 2020-09-06 23:09:21.419302924 -0400 -@@ -127,6 +127,15 @@ - { id: "browser.urlbar.suggest.openpage", type: "bool" }, +--- a/browser/components/preferences/privacy.js.orig 2021-08-17 15:39:19.662709308 -0400 ++++ b/browser/components/preferences/privacy.js 2021-08-17 16:10:17.129079115 -0400 +@@ -138,6 +138,16 @@ { id: "browser.urlbar.suggest.topsites", type: "bool" }, + { id: "browser.urlbar.suggest.engines", type: "bool" }, + // IceCat-specific + { id: "javascript.enabled", type: "bool" }, @@ -83,13 +89,14 @@ + { id: "extensions.update.enabled", type: "bool" }, + { id: "network.http.referer.spoofSource", type: "bool" }, + { id: "webgl.disabled", type: "bool" }, -+ { id: "captivedetect.canonicalURL", type: "string" }, ++ { id: "network.captive-portal-service.enabled", type: "bool" }, ++ { id: "network.connectivity-service.enabled", type: "bool" }, + { id: "browser.search.geoip.url", type: "string" }, + // History { id: "places.history.enabled", type: "bool" }, { id: "browser.formfill.enable", type: "bool" }, -@@ -615,6 +624,21 @@ +@@ -706,6 +716,24 @@ setSyncFromPrefListener("enableOCSP", () => this.readEnableOCSP()); setSyncToPrefListener("enableOCSP", () => this.writeEnableOCSP()); @@ -102,6 +109,9 @@ + setSyncFromPrefListener("detectCaptivePortal", () => this.readDetectCaptive()); + setSyncToPrefListener("detectCaptivePortal", () => this.writeDetectCaptive()); + ++ setSyncFromPrefListener("detectNetworkConnectivity", () => this.readDetectConnectivity()); ++ setSyncToPrefListener("detectNetworkConnectivity", () => this.writeDetectConnectivity()); ++ + setSyncFromPrefListener("geolocation", () => this.readGeolocation()); + setSyncToPrefListener("geolocation", () => this.writeGeolocation()); + @@ -111,7 +121,7 @@ if (AlertsServiceDND) { let notificationsDoNotDisturbBox = document.getElementById( "notificationsDoNotDisturbBox" -@@ -704,6 +728,53 @@ +@@ -825,6 +850,62 @@ SiteDataManager.updateSites(); }, @@ -136,12 +146,21 @@ + }, + + readDetectCaptive() { -+ let pref = Preferences.get("captivedetect.canonicalURL"); -+ return pref.value !== ""; ++ let pref = Preferences.get("network.captive-portal-service.enabled"); ++ return pref.value; + }, + writeDetectCaptive() { + let checkbox = document.getElementById("detectCaptivePortal"); -+ return checkbox.checked ? "http://detectportal.firefox.com/success.txt" : ""; ++ return checkbox.checked; ++ }, ++ ++ readDetectConnectivity() { ++ let pref = Preferences.get("network.connectivity-service.enabled"); ++ return pref.value; ++ }, ++ writeDetectConnectivity() { ++ let checkbox = document.getElementById("detectNetworkConnectivity"); ++ return checkbox.checked; + }, + + readGeolocation() { diff --git a/data/patches/moz-configure-changes.patch b/data/patches/moz-configure-changes.patch index 43a940a..85d5657 100644 --- a/data/patches/moz-configure-changes.patch +++ b/data/patches/moz-configure-changes.patch @@ -1,18 +1,18 @@ ---- a/browser/moz.configure -+++ b/browser/moz.configure +--- a/browser/moz.configure.orig 2021-08-17 17:06:02.522757210 -0400 ++++ b/browser/moz.configure 2021-08-17 17:06:48.846744492 -0400 @@ -5,11 +5,11 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. - imply_option('MOZ_PLACES', True) --imply_option('MOZ_SERVICES_HEALTHREPORT', True) -+imply_option('MOZ_SERVICES_HEALTHREPORT', False) - imply_option('MOZ_SERVICES_SYNC', True) --imply_option('MOZ_DEDICATED_PROFILES', True) --imply_option('MOZ_BLOCK_PROFILE_DOWNGRADE', True) --imply_option('MOZ_NORMANDY', True) -+imply_option('MOZ_DEDICATED_PROFILES', False) -+imply_option('MOZ_BLOCK_PROFILE_DOWNGRADE', False) -+imply_option('MOZ_NORMANDY', False) + imply_option("MOZ_PLACES", True) +-imply_option("MOZ_SERVICES_HEALTHREPORT", True) ++imply_option("MOZ_SERVICES_HEALTHREPORT", False) + imply_option("MOZ_SERVICES_SYNC", True) +-imply_option("MOZ_DEDICATED_PROFILES", True) +-imply_option("MOZ_BLOCK_PROFILE_DOWNGRADE", True) +-imply_option("MOZ_NORMANDY", True) ++imply_option("MOZ_DEDICATED_PROFILES", False) ++imply_option("MOZ_BLOCK_PROFILE_DOWNGRADE", False) ++imply_option("MOZ_NORMANDY", False) with only_when(target_is_linux & compile_environment): - option(env='MOZ_NO_PIE_COMPAT', + option(env="MOZ_NO_PIE_COMPAT", help="Enable non-PIE wrapper") diff --git a/data/settings.js b/data/settings.js index e4d77db..4b1867d 100644 --- a/data/settings.js +++ b/data/settings.js @@ -363,7 +363,7 @@ pref("browser.onboarding.updatetour", "performance,library,singlesearch,customiz pref("browser.onboarding.enabled", false); // New tab settings -pref("browser.newtabpage.activity-stream.default.sites", "https://www.trisquel.info/,https://www.gnu.org/,https://www.fsf.org/,https://libreplanet.org/,https://www.wikipedia.org/,https://www.wikinews.org/"); +pref("browser.newtabpage.activity-stream.default.sites", "https://www.gnu.org/,https://www.fsf.org/,https://directory.fsf.org/,https://libreplanet.org/,https://trisquel.info/,https://www.wikipedia.org/,https://www.wikinews.org/"); pref("browser.newtabpage.activity-stream.showTopSites",true); pref("browser.newtabpage.activity-stream.feeds.section.topstories",false); pref("browser.newtabpage.activity-stream.feeds.snippets",false); @@ -389,3 +389,15 @@ pref("services.settings.server", ""); // Disable use of WiFi region/location information pref("browser.region.network.scan", false); pref("browser.region.network.url", ""); + +// Disable VPN/mobile promos +pref("browser.contentblocking.report.hide_vpn_banner", true); +pref("browser.contentblocking.report.mobile-ios.url", ""); +pref("browser.contentblocking.report.mobile-android.url", ""); +pref("browser.contentblocking.report.show_mobile_app", false); +pref("browser.contentblocking.report.vpn.enabled", false); +pref("browser.contentblocking.report.vpn.url", ""); +pref("browser.contentblocking.report.vpn-promo.url", ""); +pref("browser.contentblocking.report.vpn-android.url", ""); +pref("browser.contentblocking.report.vpn-ios.url", ""); +pref("browser.privatebrowsing.promoEnabled", false); @@ -21,11 +21,11 @@ # metadata -readonly FFMAJOR=78 -readonly FFMINOR=15 +readonly FFMAJOR=91 +readonly FFMINOR=2 readonly FFSUB=0 readonly GNUVERSION=1 -readonly SOURCEBALL_CHECKSUM='a4438d84d95171a6d4fea9c9f02c2edbf0475a9c614d968ebe2eedc25a672151' +readonly SOURCEBALL_CHECKSUM='3ef3cfd321d0c2c80ee1b41b8baf7a1ea4daf93c29e1377274933440ff5e42c3' readonly SOURCEBALL_SIGNINGKEY='14F26682D0916CDD81E37B6D61B7B526D98F0353' readonly FFVERSION=${FFMAJOR}.${FFMINOR}.${FFSUB} readonly SOURCEBALL=firefox-${FFVERSION}esr.source.tar.xz @@ -41,7 +41,7 @@ readonly LIST_URL=lists.gnu.org/mailman/listinfo/bug-gnuzilla # l10n readonly L10N_URL=https://hg.mozilla.org/l10n-central readonly L10N_CMP_URL=https://hg.mozilla.org/l10n/compare-locales -readonly L10N_CMP_REV=RELEASE_8_0_0 +readonly L10N_CMP_REV=RELEASE_8_1_0 readonly L10N_PREFS_DIR=browser/chrome/browser/preferences readonly L10N_DTD_FILE=${L10N_PREFS_DIR}/advanced-scripts.dtd readonly PREFS_IN_FILE=browser/locales/en-US/browser/preferences/preferences.ftl @@ -164,6 +164,26 @@ validate_env() 'wget' from the Trisquel 'wget' package" return 1 fi + + # verify that Python 3 is available + if ! which python3 &> /dev/null + then + echo -e "\nERROR: This script requires Python 3: + e.g.: 'python3' from the Guix 'python' package + 'python3' from the Parabola 'python' package + 'python3' from the Trisquel 'python3' package" + return 1 + fi + + # verify that Python 3 jsonschema is available + if ! python3 -c 'import jsonschema' &> /dev/null + then + echo -e "\nERROR: This script requires Python 3 jsonschema: + e.g.: 'jsonschema' from the Guix 'python-jsonschema' package + 'jsonschema' from the Parabola 'python-jsonschema' package + 'jsonschema' from the Trisquel 'python3-jsonschema' package" + return 1 + fi } prepare_env() @@ -312,7 +332,7 @@ configure() # These are not condensed into a single sed script so that it # fails on individual commands that didn't change the source local activity_stream=browser/components/newtab/lib/ActivityStream.jsm - sed '/^const DEFAULT_SITES/,/^])\;/c const DEFAULT_SITES = new Map\([[""]]\);' -i $activity_stream + sed '/^const DEFAULT_SITES/,/^])\;/c const DEFAULT_SITES = new Map\([[""]]\);' -i browser/components/newtab/lib/DefaultSites.jsm sed '/"showSponsored"/,/value/s/value: true/value: false/' -i $activity_stream sed '/ "telemetry"/,/value/s/value: true/value: false/' -i $activity_stream sed '/"section\.highlights\.includePocket"/,/value/s/value: true/value: false/' -i $activity_stream @@ -320,12 +340,126 @@ configure() sed '/stories_endpoint: `/,/}`,/c stories_endpoint: "",' -i $activity_stream sed 's/\(stories_referrer:\) .http.*/\1 "",/' -i $activity_stream sed 's/\(topics_endpoint:\) .http.*/\1 "",/' -i $activity_stream - sed '/"telemetry\.structuredIngestion"/,/value/s/value: .*/value: false,/' -i $activity_stream sed '/"telemetry\.structuredIngestion\.endpoint"/,/value/s/value: .*/value: "",/' -i $activity_stream sed '/layout_endpoint:/,/http/s/"http.*/"",/' -i $activity_stream sed '/name: "telemetry"/,/value/s/value: true/value: false/' -i $activity_stream sed '/name: "system\.topstories"/,/},/s/.*!!locales.*/false/' -i $activity_stream sed 's/.Ubuntu., //' -i browser/components/newtab/css/activity-stream*.css + + sed '/^]$/d' -i browser/components/newtab/data/content/tippytop/top_sites.json + sed 's/}$/},/' -i browser/components/newtab/data/content/tippytop/top_sites.json + cat << EOF >> browser/components/newtab/data/content/tippytop/top_sites.json +{ + "domains": ["gnu.org"], + "image_url": "images/gnu.png", + "favicon_url": "favicons/gnu.ico" +}, +{ + "domains": ["fsf.org"], + "image_url": "images/fsf.png", + "favicon_url": "favicons/fsf.ico" +}, +{ + "domains": ["directory.fsf.org"], + "image_url": "images/directory.png", + "favicon_url": "favicons/fsf.ico" +}, +{ + "domains": ["libreplanet.org"], + "image_url": "images/libreplanet.png", + "favicon_url": "favicons/libreplanet.ico" +}, +{ + "domains": ["trisquel.info"], + "image_url": "images/trisquel.png", + "favicon_url": "favicons/trisquel.ico" +}, +{ + "domains": ["wikipedia.org"], + "image_url": "images/wikipedia.png", + "favicon_url": "favicons/wikipedia.ico" +}, +{ + "domains": ["wikinews.org"], + "image_url": "images/wikinews.png", + "favicon_url": "favicons/wikinews.ico" +} +] +EOF + + cat << EOF > services/settings/dumps/main/top-sites.json +{ + "data": [ + { + "url": "https://www.gnu.org/", + "order": 0, + "title": "GNU", + "id": "2a833806-e5c1-58e9-8b7c-69d9417a1253", + "last_modified": 1633983928584 + }, + { + "url": "https://www.fsf.org/", + "order": 1, + "title": "FSF", + "id": "d4e3e7e2-64d3-5bac-9c59-3c5c8e1efd8c", + "last_modified": 1633983928585 + }, + { + "url": "https://directory.fsf.org/", + "order": 2, + "title": "Free Software Directory", + "id": "dbff6206-2ada-57ad-8091-8a62ac37be4c", + "last_modified": 1633983928586 + }, + { + "url": "https://libreplanet.org/", + "order": 3, + "title": "LibrePlanet", + "id": "6f586839-4063-58b8-95ed-62e034e1915e", + "last_modified": 1633983928587 + }, + { + "url": "https://trisquel.info", + "order": 4, + "title": "Trisquel", + "id": "17aeb24c-da88-53bc-8915-c3e3d458070d", + "last_modified": 1633983928588 + }, + { + "url": "https://www.wikipedia.org/", + "order": 5, + "title": "Wikipedia", + "id": "5a18acd7-0440-5512-b3a4-20a35bdc9a1d", + "last_modified": 1633983928589 + }, + { + "url": "https://www.wikinews.org/", + "order": 6, + "title": "Wikinews", + "id": "3bb633ba-0823-4501-b3b5-bc1b8670e3e1", + "last_modified": 1633983928590 + } + ] +} +EOF + + cp "${DATADIR}"/newtab/*.ico browser/components/newtab/data/content/tippytop/favicons/ + cp "${DATADIR}"/newtab/*.png browser/components/newtab/data/content/tippytop/images/ +} + +configure_search() +{ + # Leak less info to DuckDuckGo. + sed '/"params"/,/],/d' -i browser/components/search/extensions/ddg/manifest.json + + # Add a DDG HTML search. + cp -a browser/components/search/extensions/ddg browser/components/search/extensions/ddg-html + sed 's|/duckduckgo.com/|/html.duckduckgo.com/html/|' -i browser/components/search/extensions/ddg-html/manifest.json + sed 's|DuckDuckGo|DuckDuckGo (HTML)|' -i browser/components/search/extensions/ddg-html/manifest.json + sed 's|ddg@|ddg-html@|' -i browser/components/search/extensions/ddg-html/manifest.json + + # Process various JSON pre-configuration dumps. + python3 ../../tools/process-json-files.py . browser/components/extensions/schemas/ } configure_mobile() @@ -430,7 +564,6 @@ apply_batch_branding() { find . | tac | grep -i fennec | ${RENAME_CMD} --nofullpath -E 's/fennec/icecatmobile/;' -E 's/Fennec/IceCatMobile/;' find . | tac | grep -i firefox | ${RENAME_CMD} --nofullpath -E 's/firefox/icecat/;' -E 's/Firefox/IceCat/;' - find services/fxaccounts/rust-bridge | tac | ${RENAME_CMD} --nofullpath -E 's/icecat-accounts/firefox-accounts/;' -E 's/IceCatAccounts/FirefoxAccounts/;' echo "Running batch rebranding (this will take a while)" local sed_script=" @@ -730,7 +863,8 @@ extract_sources fetch_l10n apply_patches configure -configure_mobile +configure_search +# configure_mobile apply_branding apply_batch_branding apply_icons_branding diff --git a/tools/process-json-files.py b/tools/process-json-files.py new file mode 100644 index 0000000..a20de40 --- /dev/null +++ b/tools/process-json-files.py @@ -0,0 +1,240 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2020, 2021 grizzlyuser <grizzlyuser@protonmail.com> +# Copyright (C) 2020, 2021 Ruben Rodriguez <ruben@trisquel.info> +# Copyright (C) 2021 Amin Bandali <bandali@gnu.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +import json +import sys +import time +import copy +import argparse +import pathlib +from collections import namedtuple +from jsonschema import validate + +parser = argparse.ArgumentParser() +parser.add_argument( + 'MAIN_PATH', + type=pathlib.Path, + help='path to main application source code directory') +parser.add_argument( + 'BRANDING_PATH', + type=pathlib.Path, + help='path to branding source code directory') +parser.add_argument( + '-i', + '--indent', + type=int, + default=2, + help='indent for pretty printing of output files') +arguments = parser.parse_args() + +File = namedtuple('File', ['path', 'content']) + + +class RemoteSettings: + DUMPS_PATH_RELATIVE = 'services/settings/dumps' + DUMPS_PATH_ABSOLUTE = arguments.MAIN_PATH / DUMPS_PATH_RELATIVE + + _WRAPPER_NAME = 'data' + + @classmethod + def wrap(cls, processed): + return File(processed.path, {cls._WRAPPER_NAME: processed.content}) + + @classmethod + def unwrap(cls, parsed_jsons): + return [File(json.path, json.content[cls._WRAPPER_NAME]) + for json in parsed_jsons] + + @classmethod + def should_modify_collection(cls, collection): + return True + + @classmethod + def now(cls): + return int(round(time.time() / 10 ** 6)) + + @classmethod + def process_raw(cls, unwrapped_jsons, parsed_schema): + timestamps, result = [], [] + for collection in unwrapped_jsons: + should_modify_collection = cls.should_modify_collection(collection) + for record in collection.content: + if should_modify_collection: + if cls.should_drop_record(record): + continue + + clone = copy.deepcopy(record) + + record = cls.process_record(record) + + if clone != record: + timestamp = cls.now() + while timestamp in timestamps: + timestamp += 1 + timestamps.append(timestamp) + record['last_modified'] = timestamp + + if parsed_schema is not None: + validate(record, schema=parsed_schema) + + result.append(record) + + cls.OUTPUT_PATH.parent.mkdir(parents=True, exist_ok=True) + + return File(cls.OUTPUT_PATH, result) + + @classmethod + def process(cls, parsed_jsons, parsed_schema): + return cls.wrap( + cls.process_raw( + cls.unwrap(parsed_jsons), + parsed_schema)) + + +class Changes(RemoteSettings): + JSON_PATHS = tuple(RemoteSettings.DUMPS_PATH_ABSOLUTE.glob('*/*.json')) + OUTPUT_PATH = RemoteSettings.DUMPS_PATH_ABSOLUTE / 'monitor/changes.json' + + @classmethod + def wrap(cls, processed): + return File( + processed.path, { + 'changes': processed.content, 'timestamp': cls.now()}) + + @classmethod + def process_raw(cls, unwrapped_jsons, parsed_schema): + changes = [] + + for collection in unwrapped_jsons: + if collection.path != RemoteSettings.DUMPS_PATH_ABSOLUTE / 'main/example.json': + latest_change = {} + latest_change['last_modified'] = max( + (record['last_modified'] for record in collection.content), default=0) + latest_change['bucket'] = collection.path.parent.name + latest_change['collection'] = collection.path.stem + changes.append(latest_change) + + cls.OUTPUT_PATH.parent.mkdir(parents=True, exist_ok=True) + + return File(cls.OUTPUT_PATH, changes) + + +class SearchConfig(RemoteSettings): + JSON_PATHS = ( + RemoteSettings.DUMPS_PATH_ABSOLUTE / + 'main/search-config.json', + ) + SCHEMA_PATH = arguments.MAIN_PATH / \ + 'toolkit/components/search/schema/search-engine-config-schema.json' + OUTPUT_PATH = JSON_PATHS[0] + + _DUCKDUCKGO_SEARCH_ENGINE_ID = 'ddg@search.mozilla.org' + + @classmethod + def should_drop_record(cls, search_engine): + return search_engine['webExtension']['id'] not in ( + cls._DUCKDUCKGO_SEARCH_ENGINE_ID, 'wikipedia@search.mozilla.org') + + @classmethod + def process_record(cls, search_engine): + [search_engine.pop(key, None) + for key in ['extraParams', 'telemetryId']] + + general_specifier = {} + for specifier in search_engine['appliesTo'].copy(): + if 'application' in specifier: + if 'distributions' in specifier['application']: + search_engine['appliesTo'].remove(specifier) + continue + specifier['application'].pop('extraParams', None) + + if 'included' in specifier and 'everywhere' in specifier[ + 'included'] and specifier['included']['everywhere']: + general_specifier = specifier + + if not general_specifier: + general_specifier = {'included': {'everywhere': True}} + search_engine['appliesTo'].insert(0, general_specifier) + if search_engine['webExtension']['id'] == cls._DUCKDUCKGO_SEARCH_ENGINE_ID: + general_specifier['default'] = 'yes' + + return search_engine + + +class TippyTopSites: + JSON_PATHS = ( + arguments.MAIN_PATH / + 'browser/components/newtab/data/content/tippytop/top_sites.json', + arguments.BRANDING_PATH / + 'tippytop/top_sites.json') + + @classmethod + def process(cls, parsed_jsons, parsed_schema): + tippy_top_sites_main = parsed_jsons[0] + tippy_top_sites_branding = parsed_jsons[1] + result = tippy_top_sites_branding.content + \ + [site for site in tippy_top_sites_main.content if 'wikipedia.org' in site['domains']] + return File(tippy_top_sites_main.path, result) + + +class TopSites(RemoteSettings): + _TOP_SITES_JSON_PATH = 'main/top-sites.json' + _TOP_SITES_PATH_MAIN = RemoteSettings.DUMPS_PATH_ABSOLUTE / _TOP_SITES_JSON_PATH + + JSON_PATHS = ( + arguments.BRANDING_PATH / + RemoteSettings.DUMPS_PATH_RELATIVE / + _TOP_SITES_JSON_PATH, + _TOP_SITES_PATH_MAIN) + OUTPUT_PATH = _TOP_SITES_PATH_MAIN + + @classmethod + def should_modify_collection(cls, collection): + return cls._TOP_SITES_PATH_MAIN == collection.path + + @classmethod + def should_drop_record(cls, site): + return site['url'] != 'https://www.wikipedia.org/' + + @classmethod + def process_record(cls, site): + site.pop('exclude_regions', None) + return site + + +# To reflect the latest timestamps, Changes class should always come after +# all other RemoteSettings subclasses +processors = (SearchConfig, Changes) + +for processor in processors: + parsed_jsons = [] + for json_path in processor.JSON_PATHS: + with json_path.open(encoding='utf-8') as file: + parsed_jsons.append(File(json_path, json.load(file))) + + parsed_schema = None + if hasattr(processor, "SCHEMA_PATH"): + with processor.SCHEMA_PATH.open() as file: + parsed_schema = json.load(file) + + processed = processor.process(parsed_jsons, parsed_schema) + with processed.path.open('w') as file: + json.dump(processed.content, file, indent=arguments.indent) |