From a3f4a6f2e6232c6e9e622a1cf55a6a140077bdc4 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 21 Jun 2024 10:26:57 -0700 Subject: [PATCH] disable_firefox_studies: use SUSE style and add SUSE values SUSE has a much nicer style for handling all the nested quoting and stuff in creating the autoconfig files, so switch to that, and also merge in all the SUSE autoconfig values...the more the merrier, for making Firefox be less annoying. I'm hoping this might suppress the "Add a splash of color" modal that's breaking tests ATM. Signed-off-by: Adam Williamson --- lib/utils.pm | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 4ab6216c..d59b7075 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -442,15 +442,37 @@ sub disable_firefox_studies { # https://bugzilla.mozilla.org/show_bug.cgi?id=1703903 assert_script_run 'mkdir -p $(rpm --eval %_libdir)/firefox/distribution'; assert_script_run 'printf \'{"policies": {"DisableFirefoxStudies": true, "OfferToSaveLogins": false, "OverrideFirstRunPage": "", "OverridePostUpdatePage": ""}}\' > $(rpm --eval %_libdir)/firefox/distribution/policies.json'; - # Now create a preferences override file that disables the - # quicksuggest and total cookie protection onboarding screens + # Now create a preferences override file that disables all sorts + # of annoying onboarding screens and "helpful" features that mess + # up our tests # see https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig # for why this wacky pair of files with required values is needed # and https://bugzilla.mozilla.org/show_bug.cgi?id=1703903 again - # for the actual values + # for some of the actual values, the rest I stole from SUSE + # `prepare_firefox_autoconfig` assert_script_run 'mkdir -p $(rpm --eval %_libdir)/firefox/browser/defaults/preferences'; - assert_script_run 'printf "// required comment\npref(\'general.config.filename\', \'openqa-overrides.cfg\');\npref(\'general.config.obscure_value\', 0);\n" > $(rpm --eval %_libdir)/firefox/browser/defaults/preferences/openqa-overrides.js'; - assert_script_run 'printf "// required comment\npref(\'browser.urlbar.quicksuggest.shouldShowOnboardingDialog\', false);\npref(\'privacy.restrict3rdpartystorage.rollout.enabledByDefault\', false);\n" > $(rpm --eval %_libdir)/firefox/openqa-overrides.cfg'; + type_string(q{cat < $(rpm --eval %_libdir)/firefox/browser/defaults/preferences/openqa-overrides.js +// required comment(?) +pref("general.config.filename", "openqa-overrides.cfg"); +pref("general.config.obscure_value", 0); +EOF +}); + type_string(q{cat < $(rpm --eval %_libdir)/firefox/openqa-overrides.cfg +// Mandatory comment +// https://firefox-source-docs.mozilla.org/browser/components/newtab/content-src/asrouter/docs/first-run.html +pref("app.normandy.enabled", false); +pref("browser.aboutwelcome.enabled", false); +pref("browser.discovery.enabled", false); +pref("browser.messaging-system.whatsNewPanel.enabled", false); +pref("browser.startup.upgradeDialog.enabled", false); +pref("browser.uitour.enabled", false); +pref("browser.urlbar.quicksuggest.shouldShowOnboardingDialog", false); +pref("datareporting.policy.firstRunURL", ""); +pref("messaging-system.rsexperimentloader.enabled", false); +pref("privacy.restrict3rdpartystorage.rollout.enabledByDefault", false); +pref("trailhead.firstrun.branches", "nofirstrun-empty"); +EOF +}); } sub repos_mirrorlist {