diff --git a/helpers/DATA/firefox/reprocess-search-config.py b/helpers/DATA/firefox/reprocess-search-config.py new file mode 100644 index 0000000000000000000000000000000000000000..30d56ad2c28830b5e8033db2cdfca3a66a169a09 --- /dev/null +++ b/helpers/DATA/firefox/reprocess-search-config.py @@ -0,0 +1,52 @@ +#! /usr/bin/python3 + +# Copyright (C) 2020 Ruben Rodriguez <ruben@trisquel.info> +# +# 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 + +data={} + +with open(sys.argv[1]) as f: + data=json.load(f) + + whitelist=['ddg@search.mozilla.org','google@search.mozilla.org','wikipedia@search.mozilla.org','bing@search.mozilla.org'] + + i=0 + newdata={"data":[]} + trisquel={} + + for item in data["data"]: + if item["webExtension"]["id"] in whitelist: + item["appliesTo"][0]["included"]["everywhere"]=True + item["appliesTo"][0]["default"]="no" + if item["webExtension"]["id"] == 'ddg@search.mozilla.org': + item["appliesTo"][0]["default"]="yes" + item["appliesTo"][1]["application"]["orderHint"]=5000 + item["appliesTo"][1]["application"]["override"]=True + del item["appliesTo"][1]["application"]["distributions"] + del item["appliesTo"][1]["extraParams"] + del item["extraParams"] + newdata["data"].append(item) + i+=1 + trisquel={u'webExtension': {u'id': u'trisquel@search.mozilla.org'}, u'appliesTo': [{u'included': {u'everywhere': True}, 'default': 'no'}, {u'override': True, u'application': {'override': True, 'orderHint': 4000}}], u'id': u'4341e834-7290-4d33-beb0-377c04a49566', u'last_modified': 1595254832054, u'telemetryId': u'trisquel', u'schema': 1594312388241} + ddghtml={u'webExtension': {u'id': u'ddg-html@search.mozilla.org'}, u'appliesTo': [{u'included': {u'everywhere': True}, 'default': 'no'}, {u'override': True, u'application': {'override': True, 'orderHint': 3000}}], u'id': u'55bf6437-3b82-41a6-98be-09c3b53b5b4d', u'last_modified': 1595254832054, u'telemetryId': u'ddg-html', u'schema': 1594312388241} + newdata["data"].append(trisquel) + newdata["data"].append(ddghtml) + +with open(sys.argv[1], 'w') as outfile: + json.dump(newdata, outfile, indent=4) diff --git a/helpers/DATA/firefox/searchplugins/trisquel-packages.xml b/helpers/DATA/firefox/searchplugins/trisquel-packages.xml deleted file mode 100644 index 3d336ea6b4d0a618d6b33424106315cdc8f935f7..0000000000000000000000000000000000000000 --- a/helpers/DATA/firefox/searchplugins/trisquel-packages.xml +++ /dev/null @@ -1,9 +0,0 @@ -<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"> -<os:ShortName>Trisquel Packages</os:ShortName> -<os:Description>Search packages.trisquel.info</os:Description> -<os:InputEncoding>UTF-8</os:InputEncoding> -<os:Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACi0lEQVQ4jY2T3UtTARiH92/0DxR0E10EZTeBF3VhBEqF9EEXUURUpn2AmohNS60oUrRMQ1D86ItKKz+atjmd25w5S82zlXPOqfNsc27nzOPOeboQJlakL/xuXnifi+d9Xx1bLEVZxTHhxzjsRZJXkn3dVob9gQhp+d1kFhs5rv9C6s1ufnjEjQDHhJ+bNXbOlJsprHfwyxdMAgrrHbzvcxONxXF7F6l47eRUaR+qqq4BWgwCO85+5KjeyMm7Jraf62DnhU5aDZMA3KodJByR0DSNmjdDCFML7L/Wy4IYQReNxUm52oXB7sEzG6Lb5sEx7uNgXi8pOT04JuYwO308bB3mrclNfbuTFoNAWoGJmLSCzusPcij3M6GlGJUvhzDYpymuH6Tvq5cDuX0cKzHjW1jCMxtk1DWPecRLZqkFfcPwmoNgOMrhgl5m5sJJu2UNVqZnRY7oLaSXWDlRZuFGjZ3LlVYOFpg5c6+fxVB0XeLjV07OP7LwosfFs7YxGjvGsI3Nkl5iJTW/nz3Zvey+1Mm+rA7y6uyEI9LGNWqahlOY59Ogh1HXPAA51Va2ne4gv86GazqQlPhn/fMOFCXB3qxOMu+YCASXud80RNFzC7Yx/9YAYijKrotd1LZP8OTtKG6viCSvcL16AGF6cXNATFohJbubqnffefruG+M/51FVlWaDQE3b+OYAgOyqQTKKTATEZT6YXQieAOXNIzR2Tf4N0DQNVVVZXV1FURQURcHrF8m4beTsgwFaewTKm0c4qjcy5RNJJBJJoTpN04jH40QiEUKhEKIoJuOemuFBs40rFWbuN9kYFzwEg0HC4TCSJK3/QiKRQJZlZFkmHo//N7IsI0kSiqKgaRq/AbKDgxgo7zYPAAAAAElFTkSuQmCC</os:Image> -<SearchForm>http://packages.trisquel.info/</SearchForm> -<os:Url type="text/html" method="GET" template="http://packages.trisquel.info/search?suite=default&section=all&arch=any&searchon=names&keywords={searchTerms}"> -</os:Url> -</SearchPlugin> diff --git a/helpers/DATA/firefox/searchplugins/trisquel.xml b/helpers/DATA/firefox/searchplugins/trisquel.xml deleted file mode 100644 index 610d8a955c83524c73c9b751b7591d645f5824ff..0000000000000000000000000000000000000000 --- a/helpers/DATA/firefox/searchplugins/trisquel.xml +++ /dev/null @@ -1,9 +0,0 @@ -<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/"> -<os:ShortName>Trisquel</os:ShortName> -<os:Description>Trisquel GNU/Linux</os:Description> -<os:InputEncoding>UTF-8</os:InputEncoding> -<os:Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACi0lEQVQ4jY2T3UtTARiH92/0DxR0E10EZTeBF3VhBEqF9EEXUURUpn2AmohNS60oUrRMQ1D86ItKKz+atjmd25w5S82zlXPOqfNsc27nzOPOeboQJlakL/xuXnifi+d9Xx1bLEVZxTHhxzjsRZJXkn3dVob9gQhp+d1kFhs5rv9C6s1ufnjEjQDHhJ+bNXbOlJsprHfwyxdMAgrrHbzvcxONxXF7F6l47eRUaR+qqq4BWgwCO85+5KjeyMm7Jraf62DnhU5aDZMA3KodJByR0DSNmjdDCFML7L/Wy4IYQReNxUm52oXB7sEzG6Lb5sEx7uNgXi8pOT04JuYwO308bB3mrclNfbuTFoNAWoGJmLSCzusPcij3M6GlGJUvhzDYpymuH6Tvq5cDuX0cKzHjW1jCMxtk1DWPecRLZqkFfcPwmoNgOMrhgl5m5sJJu2UNVqZnRY7oLaSXWDlRZuFGjZ3LlVYOFpg5c6+fxVB0XeLjV07OP7LwosfFs7YxGjvGsI3Nkl5iJTW/nz3Zvey+1Mm+rA7y6uyEI9LGNWqahlOY59Ogh1HXPAA51Va2ne4gv86GazqQlPhn/fMOFCXB3qxOMu+YCASXud80RNFzC7Yx/9YAYijKrotd1LZP8OTtKG6viCSvcL16AGF6cXNATFohJbubqnffefruG+M/51FVlWaDQE3b+OYAgOyqQTKKTATEZT6YXQieAOXNIzR2Tf4N0DQNVVVZXV1FURQURcHrF8m4beTsgwFaewTKm0c4qjcy5RNJJBJJoTpN04jH40QiEUKhEKIoJuOemuFBs40rFWbuN9kYFzwEg0HC4TCSJK3/QiKRQJZlZFkmHo//N7IsI0kSiqKgaRq/AbKDgxgo7zYPAAAAAElFTkSuQmCC</os:Image> -<os:Url type="text/html" method="GET" template="http://trisquel.info/search/node/{searchTerms}?page={startPage}"> -</os:Url><os:Url type="application/rss+xml" method="GET" template="http://trisquel.info/opensearch/node/{searchTerms}?page={startPage}"> -</os:Url> -</SearchPlugin> diff --git a/helpers/DATA/firefox/searchplugins/trisquel/favicon.ico b/helpers/DATA/firefox/searchplugins/trisquel/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..0c0408c1c39beaca4904137b0e715491211b5b86 Binary files /dev/null and b/helpers/DATA/firefox/searchplugins/trisquel/favicon.ico differ diff --git a/helpers/DATA/firefox/searchplugins/trisquel/manifest.json b/helpers/DATA/firefox/searchplugins/trisquel/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..c31364bf1a491c7903e76ee4563bf37a8f0189ba --- /dev/null +++ b/helpers/DATA/firefox/searchplugins/trisquel/manifest.json @@ -0,0 +1,25 @@ +{ + "name": "Trisquel", + "description": "Search Trisquel GNU/Linux site", + "manifest_version": 2, + "version": "1.0", + "applications": { + "gecko": { + "id": "trisquel@search.mozilla.org" + } + }, + "hidden": true, + "icons": { + "16": "favicon.ico" + }, + "web_accessible_resources": [ + "favicon.ico" + ], + "chrome_settings_overrides": { + "search_provider": { + "name": "Trisquel", + "search_url": "https://trisquel.info/search/node/{searchTerms}", + "search_form": "https://trisquel.info/search/node/{searchTerms}" + } + } +} diff --git a/helpers/DATA/firefox/settings.js b/helpers/DATA/firefox/settings.js index 2daf059d1043edd6279750094df1fbff126210d9..481a8c2a5f4785ac6189ecc41285fea63f1c012c 100644 --- a/helpers/DATA/firefox/settings.js +++ b/helpers/DATA/firefox/settings.js @@ -232,7 +232,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://trisquel.info/,https://www.gnu.org/,https://www.fsf.org/,https://libreplanet.org/,https://www.wikipedia.org/wiki/,https://www.wikinews.org/wiki/"); pref("browser.newtabpage.activity-stream.showTopSites",true); pref("browser.newtabpage.activity-stream.feeds.section.topstories",false); pref("browser.newtabpage.activity-stream.feeds.snippets",false); diff --git a/helpers/make-firefox b/helpers/make-firefox index 9a1b0a6738de4ff99c314c25f8ef39108c95a36f..26cc725bd3ad7494099f7d8699fc677e01486c82 100644 --- a/helpers/make-firefox +++ b/helpers/make-firefox @@ -18,13 +18,10 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -VERSION=73 +VERSION=74 . ./config -patch -p1 < debian/patches/partially-revert-google-search-update.patch -patch -p1 < debian/patches/no-region-overrides-for-google-search.patch - sed 's/clang-10 |//' -i debian/control.in sed 's/libclang-10-dev |//' -i debian/control.in sed 's/llvm-10-dev |//' -i debian/control.in @@ -89,21 +86,22 @@ sed "s/iceweasel,/iceweasel, firefox,/" -i debian/control.in sed -i /ubuntu-bookmarks/d debian/patches/series rm debian/patches/ubuntu-bookmarks* -#Unbrand url codes for google and amazon -find debian/searchplugins |grep google| xargs -i /bin/sed '/ubuntu/d; /channel/d' -i {} -find debian/searchplugins |grep amazon| xargs -i /bin/sed '/canoniccom/d;' -i {} - -#Disable canonical referrer on DDG -sed 's/&t=canonical//' -i debian/searchplugins/ddg.xml - # Make DuckDuckGo the default engine -rm debian/patches/no-region-overrides-for-google-search.patch debian/patches/partially-revert-google-search-update.patch -sed '/no-region-overrides-for-google-search/d; /partially-revert-google-search-update/d' -i debian/patches/series sed '/searchDefault/s/: \".*\"/: "DuckDuckGo"/g' -i browser/components/search/extensions/list.json sed '/visibleDefaultEngines/{n; s/"ddg",//; s/\"/"ddg", "/}' -i browser/components/search/extensions/list.json +sed '/searchOrder/s/"Google", "Bing"/"DuckDuckGo", "Google"/' -i browser/components/search/extensions/list.json -# contact link -#sed 's_https://input.mozilla.org/feedback_https://trisquel.info/contact_' -i browser/base/content/utilityOverlay.js +# Custom DDG +sed '/"params"/,/],/d' -i browser/components/search/extensions/ddg/manifest.json +cp browser/components/search/extensions/ddg browser/components/search/extensions/ddg-html -a +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 +# disable ads, disable redirect +#sed '/search/s|q=|k1=-1\&kd=-1\&ko=1\&q=|' -i browser/components/search/extensions/ddg/manifest.json + +# Reprocess search preconfiguration dump +python $DATA/reprocess-search-config.py ./services/settings/dumps/main/search-config.json cat << EOF > debian/distribution.ini [Global] @@ -176,23 +174,7 @@ rm -rf ./browser/metro ./addon-sdk/source/doc/static-files/media ./browser/theme cp $DATA/bookmarks.html.in browser/locales/generic/profile/bookmarks.html.in #Trisquel custom search engines -cp $DATA/searchplugins/*.xml debian/searchplugins/ -sed '/additions/,$d' debian/config/searchplugins.conf -i -cat << EOF >> debian/config/searchplugins.conf - "additions": [ - { - "name": "Trisquel", - "include_locales": [ "*" ], - "engine": "trisquel" - }, - { - "name": "Trisquel packages", - "include_locales": [ "*" ], - "engine": "trisquel-packages" - } - ] -} -EOF +cp -a $DATA/searchplugins/* browser/components/search/extensions/ # install extensions for extension in $(ls -1 $DATA/extensions/); do