autoconfig: move set_default_prefs down

This part is unrelated to generating the CSS files, so move it towards
the end.
This commit is contained in:
Oliver Smith 2023-04-06 21:49:19 +00:00
parent c16d19c3f5
commit 4d9ae227e2
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -112,28 +112,6 @@ function trigger_firefox_restart() {
appStartup.quit(Ci.nsIAppStartup.eForceQuit | Ci.nsIAppStartup.eRestart); 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 // Check if a CSS fragment should be used or not, depending on the current
// Firefox version. // Firefox version.
// fragment: e.g. "userChrome/popups.before-ff-108.css" // fragment: e.g. "userChrome/popups.before-ff-108.css"
@ -285,6 +263,28 @@ function css_files_update() {
set_firefox_version_previous(g_ff_version); 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() { function main() {
log("Running mobile-config-autoconfig.js"); log("Running mobile-config-autoconfig.js");
css_files_update(); css_files_update();