From 4d9ae227e2cc5c619ca14bee0d788b17b1b2a5f6 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Thu, 6 Apr 2023 21:49:19 +0000 Subject: [PATCH] autoconfig: move set_default_prefs down This part is unrelated to generating the CSS files, so move it towards the end. --- src/mobile-config-autoconfig.js | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/mobile-config-autoconfig.js b/src/mobile-config-autoconfig.js index 72121bf..e397cbe 100644 --- a/src/mobile-config-autoconfig.js +++ b/src/mobile-config-autoconfig.js @@ -112,28 +112,6 @@ function trigger_firefox_restart() { appStartup.quit(Ci.nsIAppStartup.eForceQuit | Ci.nsIAppStartup.eRestart); } -function set_default_prefs() { - log("Setting default preferences"); - // Select a mobile user agent for firefox (same as tor browser on android) - defaultPref('general.useragent.override', 'Mozilla/5.0 (Android 10; Mobile; rv:110.0) Gecko/110.0 Firefox/110.0'); - - // Do not suggest facebook, ebay, reddit etc. in the urlbar. Same as - // Settings -> Privacy & Security -> Address Bar -> Shortcuts. As - // side-effect, the urlbar results are not immediatelly opened once - // clicking the urlbar. - defaultPref('browser.urlbar.suggest.topsites', false); - - // Do not suggest search engines. Even though amazon is removed via - // policies.json, it gets installed shortly after the browser is opened. - // With this option, at least there is no big "Search with Amazon" message - // in the urlbar results as soon as typing the letter "a". - defaultPref('browser.urlbar.suggest.engines', false); - - // Show about:home in new tabs, so it's not just a weird looking completely - // empty page. - defaultPref('browser.newtabpage.enabled', true); -} - // Check if a CSS fragment should be used or not, depending on the current // Firefox version. // fragment: e.g. "userChrome/popups.before-ff-108.css" @@ -285,6 +263,28 @@ function css_files_update() { set_firefox_version_previous(g_ff_version); } +function set_default_prefs() { + log("Setting default preferences"); + // Select a mobile user agent for firefox (same as tor browser on android) + defaultPref('general.useragent.override', 'Mozilla/5.0 (Android 10; Mobile; rv:110.0) Gecko/110.0 Firefox/110.0'); + + // Do not suggest facebook, ebay, reddit etc. in the urlbar. Same as + // Settings -> Privacy & Security -> Address Bar -> Shortcuts. As + // side-effect, the urlbar results are not immediatelly opened once + // clicking the urlbar. + defaultPref('browser.urlbar.suggest.topsites', false); + + // Do not suggest search engines. Even though amazon is removed via + // policies.json, it gets installed shortly after the browser is opened. + // With this option, at least there is no big "Search with Amazon" message + // in the urlbar results as soon as typing the letter "a". + defaultPref('browser.urlbar.suggest.engines', false); + + // Show about:home in new tabs, so it's not just a weird looking completely + // empty page. + defaultPref('browser.newtabpage.enabled', true); +} + function main() { log("Running mobile-config-autoconfig.js"); css_files_update();