set Yandex as default search provider

i9-old
Arkady L. Shane 2 years ago
parent 18cbe19629
commit 62986a9ddc

@ -0,0 +1,44 @@
import json
import sys
import datetime
YANDEX_SECTION = json.loads('''
{
"appliesTo": [
{
"default": "yes",
"included": {
"everywhere": true
}
}
],
"id": "a0e7f96a-14e0-4d56-9f54-e0c7e49fd306",
"last_modified": 1679065511545,
"schema": 1639069022290,
"webExtension": {
"id": "yandex@search.mozilla.org"
}
}
''')
search_config = None
with open(sys.argv[1]) as f:
search_config = json.load(f)
inserted = False
for engine in search_config["data"]:
if engine["webExtension"]["id"] == "yandex@search.mozilla.org":
inserted = True
engine = YANDEX_SECTION
else:
for applies in engine["appliesTo"]:
if "default" in applies and applies["default"] == "yes":
applies["default"] = "no"
if not inserted:
search_config["data"] = [YANDEX_SECTION] + search_config["data"]
search_config["timestamp"] = int( datetime.datetime.now().timestamp() ) * 1000
with open(sys.argv[1], 'w') as f:
json.dump(search_config, f, indent=2)

@ -201,7 +201,7 @@ end}
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 102.9.0
Release: 3%{?dist}.inferit
Release: 3%{?dist}.inferit.1
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
@ -266,7 +266,10 @@ Source402: nspr-4.34.0-3.el8_1.src.rpm
# MSVSphere added Russian Trusted Root CA
Source500: rootca_ssl_rsa2022.cer
Source501: policies.json
# apply script from ROSA to set Yandex provides
# as default search provider for Firefox
# https://abf.rosalinux.ru/import/firefox/raw/rosa2023.1/use_yandex_search_as_default.py
Source502: use_yandex_search_as_default.py
# Build patches
Patch3: mozilla-build-arm.patch
Patch25: rhbz-1219542-s390-build.patch
@ -707,6 +710,9 @@ echo "use_rustts %{?use_rustts}"
%endif
%endif
# set Yandex search provider by default
python3 %{SOURCE502} services/settings/dumps/main/search-config.json
%{__rm} -f .mozconfig
@ -1462,6 +1468,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
* Tue Jun 27 2023 Arkady L. Shane <ashejn@msvsphere.ru> - 102.9.0-3.inferit.3
- set Yandex as default search provider
* Mon Apr 03 2023 Sergey Cherevko <s.cherevko@msvsphere.ru> - 102.3.0-6.inferit.2
- Changed https to http on start page http://msvsphere.ru

Loading…
Cancel
Save