firefox: prepare security 131.0.2 release for testing

This commit is contained in:
Luis Guzmán 2024-10-17 23:35:02 +00:00
parent e73c07bd61
commit 3f05530d6f
10 changed files with 398 additions and 245 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,9 @@
#! /usr/bin/python3 #! /usr/bin/python3
# Copyright (C) 2024 Luis Guzmán <ark@switnet.org>
# Copyright (C) 2020, 2021 grizzlyuser <grizzlyuser@protonmail.com> # Copyright (C) 2020, 2021, 2022, 2023, 2024 grizzlyuser <grizzlyuser@protonmail.com>
# Based on: https://gitlab.trisquel.org/trisquel/wrapage-helpers/-/blob/81881d89b2bf7d502dd14fcccdb471fec6f6b206/helpers/DATA/firefox/reprocess-search-config.py
# Below is the notice from the original author:
#
# Copyright (C) 2020, 2021 Ruben Rodriguez <ruben@trisquel.info> # Copyright (C) 2020, 2021 Ruben Rodriguez <ruben@trisquel.info>
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@ -23,6 +26,7 @@ import time
import copy import copy
import argparse import argparse
import pathlib import pathlib
import logging
from collections import namedtuple from collections import namedtuple
from jsonschema import validate from jsonschema import validate
@ -41,12 +45,42 @@ parser.add_argument(
type=int, type=int,
default=2, default=2,
help='indent for pretty printing of output files') help='indent for pretty printing of output files')
parser.add_argument(
'-l',
'--loglevel',
choices=logging._nameToLevel.keys(),
default=logging.INFO,
help='logging level')
arguments = parser.parse_args() arguments = parser.parse_args()
logging.basicConfig(level=arguments.loglevel)
logger = logging.getLogger(str(pathlib.Path(__file__).name))
File = namedtuple('File', ['path', 'content']) File = namedtuple('File', ['path', 'content'])
class RemoteSettings: class JsonProcessor:
@classmethod
def process(cls):
parsed_jsons = []
for json_path in cls.JSON_PATHS:
logger.info('Reading input: ' + str(json_path) + '...')
with json_path.open(encoding='utf-8') as file:
parsed_jsons.append(File(json_path, json.load(file)))
parsed_schema = None
if hasattr(cls, "SCHEMA_PATH"):
logger.info('Reading schema: ' + str(json_path) + '...')
with cls.SCHEMA_PATH.open() as file:
parsed_schema = json.load(file)
processed = cls.process_parsed(parsed_jsons, parsed_schema)
with processed.path.open('w') as file:
json.dump(processed.content, file, indent=arguments.indent)
logger.info('Wrote: ' + str(processed.path))
class RemoteSettings(JsonProcessor):
DUMPS_PATH_RELATIVE = 'services/settings/dumps' DUMPS_PATH_RELATIVE = 'services/settings/dumps'
DUMPS_PATH_ABSOLUTE = arguments.MAIN_PATH / DUMPS_PATH_RELATIVE DUMPS_PATH_ABSOLUTE = arguments.MAIN_PATH / DUMPS_PATH_RELATIVE
@ -75,11 +109,12 @@ class RemoteSettings:
@classmethod @classmethod
def now(cls): def now(cls):
return int(round(time.time() / 10 ** 6)) return int(round(time.time() * 1000))
@classmethod @classmethod
def process_raw(cls, unwrapped_jsons, parsed_schema): def process_raw(cls, unwrapped_jsons, parsed_schema):
timestamps, result = [], [] timestamps, result = [], []
for collection in unwrapped_jsons: for collection in unwrapped_jsons:
should_modify_collection = cls.should_modify_collection(collection) should_modify_collection = cls.should_modify_collection(collection)
for record in collection.content: for record in collection.content:
@ -110,13 +145,23 @@ class RemoteSettings:
return File(cls.OUTPUT_PATH, result) return File(cls.OUTPUT_PATH, result)
@classmethod @classmethod
def process(cls, parsed_jsons, parsed_schema): def process_parsed(cls, parsed_jsons, parsed_schema):
return cls.wrap( return cls.wrap(
cls.process_raw( cls.process_raw(
cls.unwrap(parsed_jsons), cls.unwrap(parsed_jsons),
parsed_schema)) parsed_schema))
class EmptyRemoteSettings(RemoteSettings):
@classmethod
def should_drop_record(cls, search_engine):
return True
@classmethod
def process_record(cls, record):
return record
class Changes(RemoteSettings): class Changes(RemoteSettings):
JSON_PATHS = tuple(RemoteSettings.DUMPS_PATH_ABSOLUTE.glob('*/*.json')) JSON_PATHS = tuple(RemoteSettings.DUMPS_PATH_ABSOLUTE.glob('*/*.json'))
OUTPUT_PATH = RemoteSettings.DUMPS_PATH_ABSOLUTE / 'monitor/changes' OUTPUT_PATH = RemoteSettings.DUMPS_PATH_ABSOLUTE / 'monitor/changes'
@ -132,7 +177,7 @@ class Changes(RemoteSettings):
changes = [] changes = []
for collection in unwrapped_jsons: for collection in unwrapped_jsons:
if collection.path not in (RemoteSettings.DUMPS_PATH_ABSOLUTE / 'main/example.json', RemoteSettings.DUMPS_PATH_ABSOLUTE / 'main/search-config-v2.json'): if collection.path != RemoteSettings.DUMPS_PATH_ABSOLUTE / 'main/example.json':
latest_change = {} latest_change = {}
latest_change[cls._LAST_MODIFIED_KEY_NAME] = cls.get_collection_timestamp( latest_change[cls._LAST_MODIFIED_KEY_NAME] = cls.get_collection_timestamp(
collection) collection)
@ -145,53 +190,108 @@ class Changes(RemoteSettings):
return File(cls.OUTPUT_PATH, changes) return File(cls.OUTPUT_PATH, changes)
class SearchConfig(RemoteSettings): class SearchConfigV2(RemoteSettings):
JSON_PATHS = ( JSON_PATHS = (
RemoteSettings.DUMPS_PATH_ABSOLUTE / RemoteSettings.DUMPS_PATH_ABSOLUTE /
'main/search-config.json', 'main/search-config-v2.json',
) )
SCHEMA_PATH = arguments.MAIN_PATH / \ SCHEMA_PATH = arguments.MAIN_PATH / \
'toolkit/components/search/schema/search-config-schema.json' 'toolkit/components/search/schema/search-config-v2-schema.json'
OUTPUT_PATH = JSON_PATHS[0] OUTPUT_PATH = JSON_PATHS[0]
_DUCKDUCKGO_SEARCH_ENGINE_ID = 'ddg@search.mozilla.org' _DUCKDUCKGO_SEARCH_ENGINE_IDENTIFIER = 'ddg'
@classmethod @classmethod
def should_drop_record(cls, search_engine): def should_drop_record(cls, record):
return search_engine['webExtension']['id'] not in ( if record['recordType'] != 'engine':
cls._DUCKDUCKGO_SEARCH_ENGINE_ID, 'wikipedia@search.mozilla.org', return False
'trisquel@search.mozilla.org', 'trisquel-packages@@search.mozilla.org',
'qwant@search.mozilla.org', 'ecosia@search.mozilla.org') identifier = record['identifier']
excluded_identifiers = ['ecosia', 'qwant', 'trisquel', 'trisquel-packages']
return (
identifier != cls._DUCKDUCKGO_SEARCH_ENGINE_IDENTIFIER and
not (identifier.startswith('wikipedia') or identifier in excluded_identifiers)
)
@classmethod @classmethod
def process_record(cls, search_engine): def process_record(cls, record):
[search_engine.pop(key, None) if record['recordType'] == 'defaultEngines':
for key in ['extraParams', 'telemetryId']] return cls.process_default_engines(record)
elif record['recordType'] == 'engine':
return cls.process_engine(record)
elif record['recordType'] == 'engineOrders':
return cls.process_engine_orders(record)
else:
return record
general_specifier = {} @classmethod
for specifier in search_engine['appliesTo'].copy(): def process_default_engines(cls, default_engines):
if 'application' in specifier: default_engines['globalDefault'] = cls._DUCKDUCKGO_SEARCH_ENGINE_IDENTIFIER
if 'distributions' in specifier['application']: default_engines['specificDefaults'] = []
search_engine['appliesTo'].remove(specifier) return default_engines
continue
specifier['application'].pop('extraParams', None)
if 'included' in specifier and 'everywhere' in specifier[ @classmethod
'included'] and specifier['included']['everywhere']: def process_engine(cls, engine):
if search_engine['webExtension']['id'] == cls._DUCKDUCKGO_SEARCH_ENGINE_ID: engine['base'].pop('partnerCode', None)
specifier['default'] = 'yes' engine['base']['urls']['search'].pop('params', None)
general_specifier = specifier
if not general_specifier: if engine['identifier'] == cls._DUCKDUCKGO_SEARCH_ENGINE_IDENTIFIER:
general_specifier = {'included': {'everywhere': True}} engine['base']['name'] += ' HTML'
search_engine['appliesTo'].insert(0, general_specifier) engine['base']['urls']['search']['base'] = 'https://html.duckduckgo.com/html'
if search_engine['webExtension']['id'] == cls._DUCKDUCKGO_SEARCH_ENGINE_ID:
general_specifier['default'] = 'yes'
return search_engine allRegions_prefixes = ['ecosia', 'qwant', 'trisquel']
if any(engine['identifier'].startswith(prefix) for prefix in allRegions_prefixes) or \
engine['identifier'] == cls._DUCKDUCKGO_SEARCH_ENGINE_IDENTIFIER:
engine['variants'] = [{'environment': {'allRegionsAndLocales': True}}]
return engine
@classmethod
def process_engine_orders(cls, engine_orders):
engine_orders['orders'] = []
return engine_orders
class SearchConfigOverridesV2(EmptyRemoteSettings):
JSON_PATHS = (
RemoteSettings.DUMPS_PATH_ABSOLUTE /
'main/search-config-overrides-v2.json',
)
SCHEMA_PATH = arguments.MAIN_PATH / \
'toolkit/components/search/schema/search-config-overrides-v2-schema.json'
OUTPUT_PATH = JSON_PATHS[0]
class TippyTopSites: class SearchDefaultOverrideAllowlist(EmptyRemoteSettings):
JSON_PATHS = (
RemoteSettings.DUMPS_PATH_ABSOLUTE /
'main/search-default-override-allowlist.json',
)
SCHEMA_PATH = arguments.MAIN_PATH / \
'toolkit/components/search/schema/search-default-override-allowlist-schema.json'
OUTPUT_PATH = JSON_PATHS[0]
class SearchTelemetryV2(EmptyRemoteSettings):
JSON_PATHS = (
RemoteSettings.DUMPS_PATH_ABSOLUTE /
'main/search-telemetry-v2.json',
)
SCHEMA_PATH = arguments.MAIN_PATH / \
'browser/components/search/schema/search-telemetry-v2-schema.json'
OUTPUT_PATH = JSON_PATHS[0]
class UrlClassifierSkipUrls(EmptyRemoteSettings):
JSON_PATHS = (
RemoteSettings.DUMPS_PATH_ABSOLUTE /
'main/url-classifier-skip-urls.json',
)
OUTPUT_PATH = JSON_PATHS[0]
class TippyTopSites(JsonProcessor):
JSON_PATHS = ( JSON_PATHS = (
arguments.MAIN_PATH / arguments.MAIN_PATH /
'browser/components/newtab/data/content/tippytop/top_sites.json', 'browser/components/newtab/data/content/tippytop/top_sites.json',
@ -199,7 +299,7 @@ class TippyTopSites:
'tippytop/top_sites.json') 'tippytop/top_sites.json')
@classmethod @classmethod
def process(cls, parsed_jsons, parsed_schema): def process_parsed(cls, parsed_jsons, parsed_schema):
tippy_top_sites_main = parsed_jsons[0] tippy_top_sites_main = parsed_jsons[0]
tippy_top_sites_branding = parsed_jsons[1] tippy_top_sites_branding = parsed_jsons[1]
result = tippy_top_sites_branding.content + \ result = tippy_top_sites_branding.content + \
@ -234,19 +334,15 @@ class TopSites(RemoteSettings):
# To reflect the latest timestamps, Changes class should always come after # To reflect the latest timestamps, Changes class should always come after
# all other RemoteSettings subclasses # all other RemoteSettings subclasses
processors = (SearchConfig, Changes) processors = (
SearchConfigV2,
SearchConfigOverridesV2,
SearchDefaultOverrideAllowlist,
SearchTelemetryV2,
UrlClassifierSkipUrls,
TopSites,
Changes,
TippyTopSites)
for processor in processors: for processor in processors:
parsed_jsons = [] processor.process()
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)

View file

@ -0,0 +1,61 @@
{
"data": [
{
"url": "https://trisquel.info/",
"order": 0,
"title": "Trisquel",
"id": "ec7f4843-6be5-5e86-870a-1c8383500a4b",
"last_modified": 1715345084783
},
{
"url": "https://packages.trisquel.org/",
"order": 1,
"title": "Trisquel Packages",
"id": "27a9b035-0b8b-4472-97cb-b1866aba0740",
"last_modified": 1715345084786
},
{
"url": "https://www.gnu.org/",
"order": 2,
"title": "GNU",
"id": "1baee931-751c-5993-b6fe-d86fbf78f9b0",
"last_modified": 1715345084789
},
{
"url": "https://www.fsf.org/",
"order": 3,
"title": "FSF",
"id": "fcc60dd8-4d97-5aca-8e5d-784652c75818",
"last_modified": 1715345084792
},
{
"url": "https://directory.fsf.org/",
"order": 4,
"title": "FSF Directory",
"id": "abe5bfb2-9487-5697-9f27-e0b782dfe006",
"last_modified": 1715345084796
},
{
"url": "https://libreplanet.org/",
"order": 5,
"title": "LibrePlanet",
"id": "e3d2cf88-a4dc-5d2e-9f9a-f3ea241d17d8",
"last_modified": 1715345084800
},
{
"url": "https://www.wikipedia.org/",
"order": 6,
"title": "Wikipedia",
"id": "02c295f5-54a8-5d29-8d1f-b619216b20c0",
"last_modified": 1715345084803
},
{
"url": "https://h-node.org/",
"order": 7,
"title": "h-node",
"id": "c426481f-8c3f-53b8-b23a-431a91a1c7b4",
"last_modified": 1715345084807
}
],
"timestamp": 1715345084810
}

View file

@ -0,0 +1,52 @@
[
{
"domains": ["duckduckgo.com"],
"image_url": "images/duckduckgo-com@2x.svg",
"favicon_url": "favicons/duckduckgo-com.ico"
},
{
"domains": ["trisquel.info"],
"image_url": "images/trisquel.png",
"favicon_url": "favicons/trisquel.ico"
},
{
"domains": ["packages.trisquel.org"],
"image_url": "images/trisquel-packages.png",
"favicon_url": "favicons/trisquel-packages.ico"
},
{
"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": ["fsfe.org"],
"image_url": "images/fsfe.png",
"favicon_url": "favicons/fsfe.ico"
},
{
"domains": ["wikipedia.org"],
"image_url": "images/wikipedia.png",
"favicon_url": "favicons/wikipedia.ico"
},
{
"domains": ["h-node.org"],
"image_url": "images/hnode.png",
"favicon_url": "favicons/hnode.ico"
}
]

View file

@ -0,0 +1,30 @@
{
"base": {
"aliases": [
"packages",
"p"
],
"classification": "unknown",
"name": "Trisquel Packages",
"urls": {
"search": {
"base": "https://packages.trisquel.org/search",
"params": [],
"searchTermParamName": "keywords"
}
}
},
"id": "b5fd21a8-e369-477f-a3f2-b47a370f9030",
"identifier": "trisquel-packages",
"last_modified": 1678,
"recordType": "engine",
"schema": "defaultEngines",
"variants": [
{
"environment": {
"allRegionsAndLocales": true
},
"optional": false
}
]
},

View file

@ -1,15 +0,0 @@
{
"schema": 1674147734592,
"appliesTo": [
{
"included": {
"everywhere": true
}
}
],
"webExtension": {
"id": "trisquel-packages@search.mozilla.org"
},
"id": "b5fd21a8-e369-477f-a3f2-b47a370f9030",
"last_modified": 1678
},

View file

@ -0,0 +1,30 @@
{
"base": {
"aliases": [
"trisquel",
"t"
],
"classification": "unknown",
"name": "Trisquel",
"urls": {
"search": {
"base": "https://trisquel.info/search/node",
"params": [],
"searchTermParamName": "q"
}
}
},
"id": "b99ed276-9557-4492-8bbb-d59826381893",
"identifier": "trisquel",
"last_modified": 1678,
"recordType": "engine",
"schema": "defaultEngines",
"variants": [
{
"environment": {
"allRegionsAndLocales": true
},
"optional": false
}
]
},

View file

@ -1,15 +0,0 @@
{
"schema": 1674147734535,
"appliesTo": [
{
"included": {
"everywhere": true
}
}
],
"webExtension": {
"id": "trisquel@search.mozilla.org"
},
"id": "b99ed276-9557-4492-8bbb-d59826381893",
"last_modified": 1678
},

View file

@ -294,3 +294,10 @@ defaultPref("browser.search.serpEventTelemetry.enabled",false);
// Disable Privacy-Preserving Attribution submition // Disable Privacy-Preserving Attribution submition
pref("dom.private-attribution.submission.enabled", false); pref("dom.private-attribution.submission.enabled", false);
// Disable Machine Learning
defaultPref("browser.ml.enabled", false);
defaultPref("browser.ml.chat.enabled", false);
// Hide from UI
defaultPref("browser.ml.chat.hideFromLabs", true);
defaultPref("browser.ml.chat.hideLabsShortcuts", true);

View file

@ -19,12 +19,18 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# #
VERSION=112 VERSION=115
EXTERNAL='deb-src http://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu $UPSTREAM main' EXTERNAL='deb-src http://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu $UPSTREAM main'
REPOKEY=9BDB3D89CE49EC21 REPOKEY=9BDB3D89CE49EC21
. ./config . ./config
# SHA256 HASHES UPDATES
GLEAN_CONF_RS_INITIAL=$(sha256sum third_party/rust/glean/src/configuration.rs|awk '{print$1}')
# GNUZILLA ADDON REPLACEMENT
OLD_WEB_DEV_URL="https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/"
WEB_DEV_URL="https://gnuzilla.gnu.org/mozzarella/category.php?id=web-development"
rm debian/control rm debian/control
# Disable remote settings antifeature. # Disable remote settings antifeature.
@ -34,6 +40,7 @@ sed '/async download.*/areturn;' -i services/settings/RemoteSettingsClient.sys.m
# Disable activity-stream antifeatures. # Disable activity-stream antifeatures.
# These are not condensed into a single sed script to make it fail on individual commands that didn't change the source # These are not condensed into a single sed script to make it fail on individual commands that didn't change the source
ActivityStream=browser/components/newtab/lib/ActivityStream.sys.mjs ActivityStream=browser/components/newtab/lib/ActivityStream.sys.mjs
BAP_FirefoxJs=browser/app/profile/firefox.js
sed '/^const DEFAULT_SITES/,/^])\;/c const DEFAULT_SITES = new Map\([[""]]\);' -i browser/components/newtab/lib/DefaultSites.sys.mjs sed '/^const DEFAULT_SITES/,/^])\;/c const DEFAULT_SITES = new Map\([[""]]\);' -i browser/components/newtab/lib/DefaultSites.sys.mjs
sed '/"showSponsored"/,/value/s/value: true/value: false/' -i $ActivityStream sed '/"showSponsored"/,/value/s/value: true/value: false/' -i $ActivityStream
sed '/"telemetry"/,/value/s/value: true/value: false/' -i $ActivityStream sed '/"telemetry"/,/value/s/value: true/value: false/' -i $ActivityStream
@ -44,33 +51,33 @@ sed '/stories_endpoint/s/getpocket.cdn.mozilla.net/127.0.0.1/' -i $ActivityStrea
sed '/stories_referrer/s/http.*/",/' -i $ActivityStream sed '/stories_referrer/s/http.*/",/' -i $ActivityStream
sed '/topics_endpoint/s/getpocket.cdn.mozilla.net/127.0.0.1/' -i $ActivityStream sed '/topics_endpoint/s/getpocket.cdn.mozilla.net/127.0.0.1/' -i $ActivityStream
sed 's/preffedRegions.includes.geo. .. ..locales .. locales.includes.locale./false/' -i $ActivityStream sed 's/preffedRegions.includes.geo. .. ..locales .. locales.includes.locale./false/' -i $ActivityStream
sed 's/Ubuntu, //' -i browser/components/newtab/css/activity-stream*.css #sed 's/Ubuntu, //' -i browser/components/newtab/css/activity-stream*.css
echo "#header-asrouter-container{display: none!important;}" >> browser/components/newtab/css/activity-stream-linux.css #echo "#header-asrouter-container{display: none!important;}" >> browser/components/newtab/css/activity-stream-linux.css
#Disable «Sponsored tiles on the New Tab page» - firefox 92+94 #Disable «Sponsored tiles on the New Tab page» - firefox 92+94
sed '/"showSponsoredTopSites"/,/value/s/value: true/value: false/' -i $ActivityStream sed '/"showSponsoredTopSites"/,/value/s/value: true/value: false/' -i $ActivityStream
sed -i '/activity-stream.showSponsored/s|true|false|g' browser/app/profile/firefox.js sed -i '/activity-stream.showSponsored/s|true|false|g' $BAP_FirefoxJs
#Disable «Mozilla VPN» - firefox 94 #Disable «Mozilla VPN» - firefox 94
sed '/"browser.privatebrowsing.vpnpromourl"/s/https.*"/"/' -i browser/app/profile/firefox.js sed '/"browser.privatebrowsing.vpnpromourl"/s/https.*"/"/' -i $BAP_FirefoxJs
grep -rl browser.vpn_promo.enabled | xargs -r sed -i '/browser.vpn_promo.enabled/s|true|false|' grep -rl browser.vpn_promo.enabled | xargs -r sed -i '/browser.vpn_promo.enabled/s|true|false|'
sed '/network.connectivity-service.IPv/s/http.*success.txt?ipv[46]//' -i modules/libpref/init/all.js sed '/network.connectivity-service.IPv/s/http.*success.txt?ipv[46]//' -i modules/libpref/init/all.js
sed 's/accounts-static.cdn.mozilla.net.*sync.services.mozilla.com//' -i modules/libpref/init/all.js sed 's/accounts-static.cdn.mozilla.net.*sync.services.mozilla.com//' -i modules/libpref/init/all.js
# Disable 106 firefox-view and other firefox-branded popups # Disable 106 firefox-view and other firefox-branded popups
sed -i '/browser.urlbar.quicksuggest.shouldShowOnboardingDialog/s|true|false|' browser/app/profile/firefox.js sed -i '/browser.urlbar.quicksuggest.shouldShowOnboardingDialog/s|true|false|' $BAP_FirefoxJs
sed -i '/services.sync.prefs.sync.browser.firefox-view.feature-tour/s|true|false|' browser/app/profile/firefox.js sed -i '/services.sync.prefs.sync.browser.firefox-view.feature-tour/s|true|false|' $BAP_FirefoxJs
##disable firefox-view ##disable firefox-view
##sed -i '/"browser.tabs.firefox-view"/s|true|false|' browser/app/profile/firefox.js #deprecated -v127 ##sed -i '/"browser.tabs.firefox-view"/s|true|false|' browser/app/profile/firefox.js #deprecated -v127
##disable ui tour ##disable ui tour
sed -i '/browser.uitour.enabled/s|true|false|' browser/app/profile/firefox.js sed -i '/browser.uitour.enabled/s|true|false|' $BAP_FirefoxJs
##disable colorways closet ##disable colorways closet
sed -i '/browser.theme.colorway-closet/s|true|false|' browser/app/profile/firefox.js sed -i '/browser.theme.colorway-closet/s|true|false|' $BAP_FirefoxJs
##disable newtab intro - check adjustment for versions greater than 106 ##disable newtab intro - check adjustment for versions greater than 106
#grep -rl browser.newtabpage.introShown |xargs -r sed -i '/browser.newtabpage.introShown/s|true|false|' #grep -rl browser.newtabpage.introShown |xargs -r sed -i '/browser.newtabpage.introShown/s|true|false|'
##Remove mailto handlers. 110 ##Remove mailto handlers. 110
sed -i '/kHandlerList = {/,/^ };/{/^ /d}' uriloader/exthandler/HandlerList.sys.mjs sed -i '/kHandlerList = {/,/^ };/{/^ /d}' uriloader/exthandler/HandlerList.sys.mjs
# keep contectRelevancy disabled (first appearence is false thus using /bin/sed) # keep contectRelevancy disabled (first appearence is false thus using /bin/sed)
/bin/sed -i '/"toolkit.contentRelevancy.ingestEnabled"/s|,.*)|, false)|' browser/app/profile/firefox.js /bin/sed -i '/"toolkit.contentRelevancy.ingestEnabled"/s|,.*)|, false)|' $BAP_FirefoxJs
# Replace ubufox recommendation # Replace ubufox recommendation
sed 's/xul-ext-ubufox/xul-ext-youtube-html5-video-player/' -i debian/control.in sed 's/xul-ext-ubufox/xul-ext-youtube-html5-video-player/' -i debian/control.in
@ -106,19 +113,27 @@ grep -rl toolkit.telemetry.bhrPing.enabled | xargs -r sed -i '/toolkit.telemetr
grep -rl security.certerrors.recordEventTelemetry | xargs -r sed -i '/security.certerrors.recordEventTelemetry/s|true|false|' grep -rl security.certerrors.recordEventTelemetry | xargs -r sed -i '/security.certerrors.recordEventTelemetry/s|true|false|'
grep -rl services.sync.telemetry.maxPayloadCount modules/ | xargs -r sed -i '/services.sync.telemetry.maxPayloadCount/s|500|-1|' grep -rl services.sync.telemetry.maxPayloadCount modules/ | xargs -r sed -i '/services.sync.telemetry.maxPayloadCount/s|500|-1|'
grep -rl services.sync.telemetry.submissionInterval modules/ | xargs -r sed -i '/services.sync.telemetry.submissionInterval/s|43200|-1|' grep -rl services.sync.telemetry.submissionInterval modules/ | xargs -r sed -i '/services.sync.telemetry.submissionInterval/s|43200|-1|'
echo 'pref("dom.security.unexpected_system_load_telemetry_enabled", false);' | tee -a browser/app/profile/firefox.js echo 'pref("dom.security.unexpected_system_load_telemetry_enabled", false);' | tee -a $BAP_FirefoxJs
echo 'pref("toolkit.telemetry.hybridContent.enabled", false);' | tee -a browser/app/profile/firefox.js echo 'pref("toolkit.telemetry.hybridContent.enabled", false);' | tee -a $BAP_FirefoxJs
# GPC opt-out entry added on 120 (not enabled yet). # GPC opt-out entry added on 120 (not enabled yet).
echo '//pref("privacy.globalprivacycontrol.enabled", true);' | tee -a browser/app/profile/firefox.js echo '//pref("privacy.globalprivacycontrol.enabled", true);' | tee -a $BAP_FirefoxJs
# Disable translataion popup
grep -rl browser.translations.automaticallyPopup modules/ | xargs -r sed -i '/browser.translations.automaticallyPopup/s|true|false|'
# Disable Firefox Relay
sed -i '/signon.firefoxRelay.feature/c pref("signon.firefoxRelay.feature", "disabled");' $BAP_FirefoxJs
# Update third_party/rust/glean/src/configuration.rs sha256sum at third_party/rust/glean/.cargo-checksum.json # Update third_party/rust/glean/src/configuration.rs sha256sum at third_party/rust/glean/.cargo-checksum.json
sed_csum 27075b12236021c54d0c99427bcbd417933ca02545275604d3c13f32ca25af13 \ GLEAN_CONF_RS_MODIFIED=$(sha256sum third_party/rust/glean/src/configuration.rs|awk '{print$1}')
f354c756cb723a386263a3ad4669a1d5cc743379c7c620b14f894f505cf83500 sed_csum $GLEAN_CONF_RS_INITIAL \
$GLEAN_CONF_RS_MODIFIED
# Remove Google API key and calls # Remove Google API key and calls
sed '/Google API/,/google-api-keyfile/ d' debian/config/mozconfig.in -i sed '/Google API/,/google-api-keyfile/ d' debian/config/mozconfig.in -i
sed '/"geo.provider.network.url"/s|https.*"|"|' -i modules/libpref/init/all.js sed '/"geo.provider.network.url"/s|https.*"|"|' -i modules/libpref/init/all.js
# Disable save password in browser suggestion.
#grep -lr '^pref("signon.rememberSignons"'| xargs sed -i "/^pref(\"signon.rememberSignons\"/s|true|false|" modules/libpref/init/all.js
# Org branding # Org branding
sed 's/com.ubuntu/org.trisquel/' -i debian/config/mozconfig.in sed 's/com.ubuntu/org.trisquel/' -i debian/config/mozconfig.in
@ -151,123 +166,7 @@ sed "s/iceweasel,/iceweasel, firefox,/" -i debian/control.in
sed -i /ubuntu-bookmarks/d debian/patches/series sed -i /ubuntu-bookmarks/d debian/patches/series
rm debian/patches/ubuntu-bookmarks* rm debian/patches/ubuntu-bookmarks*
# Custom newtab images # Custom newtab images at DATA/firefox/search-custom/
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": ["trisquel.info"],
"image_url": "images/trisquel.png",
"favicon_url": "favicons/trisquel.ico"
},
{
"domains": ["packages.trisquel.org"],
"image_url": "images/trisquel-packages.png",
"favicon_url": "favicons/trisquel-packages.ico"
},
{
"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": ["fsfe.org"],
"image_url": "images/fsfe.png",
"favicon_url": "favicons/fsfe.ico"
},
{
"domains": ["wikipedia.org"],
"image_url": "images/wikipedia.png",
"favicon_url": "favicons/wikipedia.ico"
},
{
"domains": ["h-node.org"],
"image_url": "images/hnode.png",
"favicon_url": "favicons/hnode.ico"
}
]
EOF
#uuidgen --sha1 --namespace @dns --name "trisquel.info"
cat << TOP_JSON > services/settings/dumps/main/top-sites.json
{
"data": [
{
"url": "https://trisquel.info/",
"order": 0,
"title": "Trisquel",
"id": "ec7f4843-6be5-5e86-870a-1c8383500a4b",
"last_modified": $(date +%s%N | cut -b1-13)
},
{
"url": "https://packages.trisquel.org/",
"order": 1,
"title": "Trisquel Packages",
"id": "27a9b035-0b8b-4472-97cb-b1866aba0740",
"last_modified": $(date +%s%N | cut -b1-13)
},
{
"url": "https://www.gnu.org/",
"order": 2,
"title": "GNU",
"id": "1baee931-751c-5993-b6fe-d86fbf78f9b0",
"last_modified": $(date +%s%N | cut -b1-13)
},
{
"url": "https://www.fsf.org/",
"order": 3,
"title": "FSF",
"id": "fcc60dd8-4d97-5aca-8e5d-784652c75818",
"last_modified": $(date +%s%N | cut -b1-13)
},
{
"url": "https://directory.fsf.org/",
"order": 4,
"title": "FSF Directory",
"id": "abe5bfb2-9487-5697-9f27-e0b782dfe006",
"last_modified": $(date +%s%N | cut -b1-13)
},
{
"url": "https://libreplanet.org/",
"order": 5,
"title": "LibrePlanet",
"id": "e3d2cf88-a4dc-5d2e-9f9a-f3ea241d17d8",
"last_modified": $(date +%s%N | cut -b1-13)
},
{
"url": "https://www.wikipedia.org/",
"order": 6,
"title": "Wikipedia",
"id": "02c295f5-54a8-5d29-8d1f-b619216b20c0",
"last_modified": $(date +%s%N | cut -b1-13)
},
{
"url": "https://h-node.org/",
"order": 7,
"title": "h-node",
"id": "c426481f-8c3f-53b8-b23a-431a91a1c7b4",
"last_modified": $(date +%s%N | cut -b1-13)
}
],
"timestamp": $(date +%s%N | cut -b1-13)
}
TOP_JSON
cp $DATA/newtab/*.ico browser/components/newtab/data/content/tippytop/favicons/ cp $DATA/newtab/*.ico browser/components/newtab/data/content/tippytop/favicons/
cp $DATA/newtab/*.png browser/components/newtab/data/content/tippytop/images/ cp $DATA/newtab/*.png browser/components/newtab/data/content/tippytop/images/
@ -277,20 +176,17 @@ cp browser/components/search/extensions/ddg browser/components/search/extensions
sed 's|/duckduckgo.com/|/html.duckduckgo.com/html/|' -i browser/components/search/extensions/ddg-html/manifest.json 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|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 sed 's|ddg@|ddg-html@|' -i browser/components/search/extensions/ddg-html/manifest.json
patch_p1 $DATA/rollback_ddg_firefox_partnership_codes.patch
# disable ads, disable redirect # disable ads, disable redirect
#sed '/search/s|q=|k1=-1\&kd=-1\&ko=1\&q=|' -i browser/components/search/extensions/ddg/manifest.json #sed '/search/s|q=|k1=-1\&kd=-1\&ko=1\&q=|' -i browser/components/search/extensions/ddg/manifest.json
#Trisquel custom search engines #Trisquel custom search engines
cp -a $DATA/searchplugins/* browser/components/search/extensions/ cp -a $DATA/searchplugins/* browser/components/search/extensions/
/bin/sed "/\"data\": \[/ r $DATA/searchplugins/trisquel.json" -i ./services/settings/dumps/main/search-config.json /bin/sed "/\"data\": \[/ r $DATA/searchplugins/trisquel-v2.json" -i ./services/settings/dumps/main/search-config-v2.json
/bin/sed "/\"data\": \[/ r $DATA/searchplugins/trisquel-packages.json" -i ./services/settings/dumps/main/search-config.json /bin/sed "/\"data\": \[/ r $DATA/searchplugins/trisquel-packages-v2.json" -i ./services/settings/dumps/main/search-config-v2.json
echo "Customizing search engines..." echo "Customizing search engines..."
# Reprocess search preconfiguration dump # Reprocess search preconfiguration dump
python3 $DATA/process-json-files.py . browser/components/extensions/schemas/ python3 $DATA/process-json-files.py . $DATA/search-custom/
# Disable new search config 'til new one gets figured out (ref: https://hg.mozilla.org/mozilla-central/rev/bad743156b30)
patch_Rp1 $DATA/firefox_permanently_enable_new_search_engine_config.patch
cat << EOF > debian/distribution.ini cat << EOF > debian/distribution.ini
[Global] [Global]
@ -318,6 +214,13 @@ cp -a $DATA/branding/* browser/branding/unofficial
cp -a $DATA/branding/* browser/branding/nightly cp -a $DATA/branding/* browser/branding/nightly
cp -a $DATA/branding/* browser/branding/aurora cp -a $DATA/branding/* browser/branding/aurora
# Replace/remove brand name on used view(s) to avoid branding issues.
for i in $(find . -name brandings.ftl)
do
/bin/sed -i '/firefoxview-brand-name/s|Firefox View|Abrowser View|' $i
sed -i 's|= Firefox |= |' $i
done
sed '/about-wordmark.svg/d' -i browser/base/content/aboutDialog.css sed '/about-wordmark.svg/d' -i browser/base/content/aboutDialog.css
echo '#warningDesc, #communityExperimentalDesc, #communityDesc, #contributeDesc {display:none!important}' >> browser/base/content/aboutDialog.css echo '#warningDesc, #communityExperimentalDesc, #communityDesc, #contributeDesc {display:none!important}' >> browser/base/content/aboutDialog.css
# Disable preprocessor # Disable preprocessor
@ -351,6 +254,7 @@ s|Sign in to Firefox|Sign in to Sync|;
s|Search addons.mozilla.org|Search|g; s|Search addons.mozilla.org|Search|g;
s|firefox.settings.services.mozilla.com|127.0.0.1|g; s|firefox.settings.services.mozilla.com|127.0.0.1|g;
s|this-firefox|this-abrowser|g; s|this-firefox|this-abrowser|g;
s|firefox-help|abrowser-help|g;
" "
echo "Running batch replace operation" echo "Running batch replace operation"
@ -468,6 +372,7 @@ find browser/branding/ -name PrivateBrowsing_150.png | xargs -n1 cp $DATA/debug_
# Replace addons placeholder for the gnuzilla mozzarella. # Replace addons placeholder for the gnuzilla mozzarella.
find l10n/ -name aboutAddons.ftl | xargs -r sed -i '/.placeholder/s|addons.mozilla.org|gnuzilla.gnu.org|g' find l10n/ -name aboutAddons.ftl | xargs -r sed -i '/.placeholder/s|addons.mozilla.org|gnuzilla.gnu.org|g'
sed -i "s|$OLD_WEB_DEV_URL|$WEB_DEV_URL|" devtools/client/menus.js
#Fixes by patch on source, see DATA/firefox/patches for more info. #Fixes by patch on source, see DATA/firefox/patches for more info.
for patch in $(ls -v ${DATA}/patch_changes/*.patch) for patch in $(ls -v ${DATA}/patch_changes/*.patch)
@ -488,7 +393,7 @@ do
[ -d $HOMEDIR/.mozilla/firefox ] || continue [ -d $HOMEDIR/.mozilla/firefox ] || continue
echo Linking $HOMEDIR/.mozilla/firefox into $HOMEDIR/.mozilla/abrowser echo Linking $HOMEDIR/.mozilla/firefox into $HOMEDIR/.mozilla/abrowser
ln -s $HOMEDIR/.mozilla/firefox $HOMEDIR/.mozilla/abrowser ln -s $HOMEDIR/.mozilla/firefox $HOMEDIR/.mozilla/abrowser
done done
fi fi
exit 0 ' >> debian/abrowser.postinst.in exit 0 ' >> debian/abrowser.postinst.in