Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Share your browser prefs.js!

The advances users of Mozilla-based web browsers tend to have a large set of preferences. Let's start a trend of sharing them! I throw all my settings into one prefs.js that gets distributed through my various means to the system directory. That's why you see pref() here instead of user_pref(). Not all of these options apply to each browser, but the extra ones do not hurt. So these could affect Waterfox, Palemoon, or Firefox web browsers.

// file: /usr/lib/waterfox/browser/defaults/preferences/bgstack15-waterfox-prefs.js
// last modified 2020-04-15
// reference:
//    https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig
// Turn off updates. I use my package manager for browser updates.
pref("app.update.auto",                     false);
pref("app.update.autoInstallEnabled",       false);
pref("app.update.enabled",                  false);
pref("extensions.update.autoUpdateDefault", false);
// Disable previews of tabs. I just do not like the feature
pref("browser.allTabs.previews", false);
pref("browser.ctrlTab.previews", false);
pref("browser.ctrlTab.recentlyUsedOrder", false);
// Old-style backspace action to navigate backwards through browsing history.
pref("browser.backspace_action", 0);
// Do not prompt for download location. Just use ~/Downloads.
pref("browser.download.useDownloadDir", true);
// Show blank page on a new tab.
pref("browser.newtab.choice", 1);
pref("browser.newtabpage.enabled", false);
pref("browser.newtabpage.storageVersion", 1);
// Do not suggest similar searches when typing into the bar. 
pref("browser.search.suggest.enabled", false);
// Disable these by choice.
pref("browser.safebrowsing.malware.enabled", false);
pref("browser.safebrowsing.phishing.enabled", false);
// Hide this search plugin.
pref("browser.search.hiddenOneOffs", "DuckDuckGo");
// Do not automatically check for updates to search plugins.
pref("browser.search.update", false);
// Do not show separate widget in navigation bar.
pref("browser.search.widget.inNavBar", false);
// Load all tabs when starting browser. I hate load-on-demand, which is when it loads only when you switch to that tab.
pref("browser.sessionstore.restore_on_demand", false);
// Do not check if this is the OS default browser.
pref("browser.shell.checkDefaultBrowser",   false);
// Set my home page.
pref("browser.startup.homepage",            "data:text/plain,browser.startup.homepage=https://start.duckduckgo.com/");
pref("browser.startup.page", 3);
// Closing the last tab does not close the browser window.
pref("browser.tabs.closeWindowWithLastTab", false);
// Obviously I did not type this one myself. This controls the layout of the buttons on the navigation bar.
pref("browser.uiCustomization.state", "{\"placements\":{\"PanelUI-contents\":[\"edit-controls\",\"zoom-controls\",\"new-window-button\",\"e10s-button\",\"privatebrowsing-button\",\"save-page-button\",\"print-button\",\"history-panelmenu\",\"fullscreen-button\",\"find-button\",\"preferences-button\",\"add-ons-button\",\"developer-button\",\"sync-button\"],\"addon-bar\":[\"addonbar-closebutton\",\"status-bar\"],\"PersonalToolbar\":[\"personal-bookmarks\"],\"nav-bar\":[\"urlbar-container\",\"bookmarks-menu-button\",\"downloads-button\",\"home-button\",\"jid1-n8wh2cbfc2qauj_jetpack-browser-action\",\"ublock0_raymondhill_net-browser-action\",\"_f73df109-8fb4-453e-8373-f59e61ca4da3_-browser-action\"],\"TabsToolbar\":[\"tabbrowser-tabs\",\"new-tab-button\",\"alltabs-button\"],\"toolbar-menubar\":[\"menubar-items\"]},\"seen\":[\"jid1-n8wh2cbfc2qauj_jetpack-browser-action\",\"ublock0_raymondhill_net-browser-action\",\"_f73df109-8fb4-453e-8373-f59e61ca4da3_-browser-action\",\"developer-button\"],\"dirtyAreaCache\":[\"PersonalToolbar\",\"nav-bar\",\"TabsToolbar\",\"toolbar-menubar\",\"PanelUI-contents\",\"addon-bar\"],\"currentVersion\":6,\"newElementCount\":0}");
// Use dense view.
pref("browser.uidensity", 1);
// Do not hide the http and colon-slash-slash elements of a URL in the url bar.
pref("browser.urlbar.trimURLs", false);
// Disable enlarged-upon-selected url bar.
pref("browser.urlbar.update1", false);
// Allow me to see ssl error messages (and the ability to continue past them).
pref("browser.xul.error_pages.enabled", false);
// Do not use webcam for this feature.
pref("camera.control.face_detection.enabled", false);
// Null-route these URLs
pref("captivedetect.canonicalURL", "http://127.0.0.1:9999/");
pref("devtools.devedition.promo.url", "https://127.0.0.1:9999/");
pref("dom.push.serverURL", "wss://127.0.0.1:9999/");
pref("security.ssl.errorReporting.url", "http://127.0.0.1:9999/");
pref("services.settings.server", "http://127.0.0.1:9999/");
pref("webextensions.storage.sync.serverURL", "http://127.0.0.1:9999/");
// Metadata that is not very important but it ended up in my copy-paste work.
pref("distribution.stackrpms.bookmarksProcessed", true);
// Disable Mozilla experiments.
pref("experiments.activeExperiment", false);
// This plugin is probably uBlock origin.
pref("extensions.enabledAddons", "%7B972ce4c6-7e08-4474-a285-3208198ce6fd%7D:28.3.0");
// Tell the browser that we already showed the user the page for "Select your addons" so it does not bother the user.
pref("extensions.shownSelectionUI", true);
// Already assume these plugins are enabled. This can help suppress the warning, "An admin added these plugins. Please choose to enable them or not."
pref("extensions.webextensions.uuids", "{\"uBlock0@raymondhill.net\":\"7f64930e-0e43-4813-97c3-6fcb8a82e63b\",\"jid1-n8wH2cBfc2QaUj@jetpack\":\"5b1c5018-34cd-4778-902b-08741e3d0002\",\"{f73df109-8fb4-453e-8373-f59e61ca4da3}\":\"b7ece467-f6eb-4254-a815-1029330a9793\"}");
// Select "Highlight all" for the find function.
pref("findbar.highlightAll", true);
// Miscellaneous
pref("gecko.handlerService.migrated", true);
pref("marionette.prefs.recommended", false);
pref("network.cookie.prefsMigrated", true);
pref("privacy.sanitize.migrateFx3Prefs", true);
// Do not warn me when entering about:config
pref("general.warnOnAboutConfig", false);
// Disable geolocation functions
pref("geo.enabled", false);
// Trust my domain for Kerberos authentication
pref("network.automatic-ntlm-auth.trusted-uris", ".ipa.example.com");
pref("network.negotiate-auth.trusted-uris", ".ipa.example.com");
// Disable the captive portal detection logic.
pref("network.captive-portal-service.enabled", false);
// Disable dns prefetching (exactly what it sounds like).
pref("network.dns.disablePrefetch", true);
// Disable whatever these are.
pref("network.predictor.enabled", false);
pref("network.prefetch-next", false);
// Disable requiring HSTS. Use at my own risk!
pref("network.stricttransportsecurity.preloadlist", false);
// Disable Reader mode.
pref("reader.parse-on-load.enabled", false);
// More personal ssl choices. Use at my own risk!
pref("security.cert_pinning.enforcement_level", 0);
// Hide these search plugins. Somehow the Debian package search keeps getting re-enabled so I need to work on this one.
pref("services.sync.declinedEngines", "");
// Startup home page (if I were to choose the option "Load these pages at startup," which I did not)
pref("startup.homepage_override_url",       "");
pref("startup.homepage_override_url", "");
// Hm, there should be more of these, particularly toolkit.telemetry.enabled = false
pref("toolkit.telemetry.reportingpolicy.firstRun", false);
// Trust these domain names for installing extensions: none!
pref("xpinstall.whitelist.add", "");
// Control DNS over HTTPS (DoH) and Trusted Recursive Resolver (TRR).
// More about DoH: https://github.com/bambenek/block-doh
// https://blog.nightly.mozilla.org/2018/06/01/improving-dns-privacy-in-firefox/
// https://support.mozilla.org/en-US/kb/configuring-networks-disable-dns-over-https
// https://wiki.mozilla.org/Trusted_Recursive_Resolver
// 0: Off by default, 1: Firefox chooses faster, 2: TRR default w/DNS fallback,
// 3: TRR only mode, 4: Use DNS and shadow TRR for timings, 5: Disabled.
pref("network.trr.mode", 0);
// Disable Pocket and null-route the URLs.
pref("extensions.pocket.enabled", false);
pref("extensions.pocket.api", "http://localhost:9980");
pref("extensions.pocket.site", "http://localhost:9980");

Comments