Skip to content

Instantly share code, notes, and snippets.

@apfelchips
Last active February 26, 2024 04:21
Show Gist options
  • Save apfelchips/f129c8316055e524774d757365267e26 to your computer and use it in GitHub Desktop.
Save apfelchips/f129c8316055e524774d757365267e26 to your computer and use it in GitHub Desktop.
~ 🥖.config🥖firefox🥖Profiles🥖profile.default🥖user.js
// src: https://gist.github.com/apfelchips/f129c8316055e524774d757365267e26
// goal: disable all annoying stuff from firefox and tighten security, but still retain all modern web features
// configure as little as possible to benefit from changeing/hardened defaults by Mozilla
// inspired by:
// https://github.com/pyllyukko/user.js/blob/master/user.js
// https://github.com/ghacksuserjs/ghacks-user.js/blob/master/user.js
// http://kb.mozillazine.org/About:config_entries
// https://gist.github.com/ruilapa/3207798
// https://jm42.github.io/compare-user.js/
// https://gitlab.com/librewolf-community/settings/-/blob/master/librewolf.cfg#L1
// pref() <= change default, can be edited by user
// user_pref() <= override everything, defined setting will be set on startup
// more info:
// https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences
// recommended addons
// https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/
// https://addons.mozilla.org/en-US/firefox/addon/container-color-toolbar/
// https://addons.mozilla.org/en-US/firefox/addon/switch-container-plus/
// https://addons.mozilla.org/en-US/firefox/addon/open-url-in-container/
// https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/
// https://addons.mozilla.org/en-US/firefox/addon/istilldontcareaboutcookies/
// https://addons.mozilla.org/en-US/firefox/addon/cookie-autodelete/
// https://addons.mozilla.org/en-US/firefox/addon/open-link-in-browser-as/
// https://addons.mozilla.org/en-US/firefox/addon/redirector/
// https://addons.mozilla.org/en-US/firefox/addon/keepass-helper-url-in-title/
// https://addons.mozilla.org/de/firefox/addon/bid-o-matic-be/
// https://addons.mozilla.org/en-US/firefox/addon/hls-stream-detector/
// https://addons.mozilla.org/en-US/firefox/addon/remove-cookies-button-ver1x/
// https://addons.mozilla.org/en-US/firefox/addon/cookie-quick-manager/
// https://addons.mozilla.org/en-US/firefox/addon/uaswitcher/
// https://addons.mozilla.org/en-US/firefox/addon/referercontrol/
// https://addons.mozilla.org/en-US/firefox/addon/clearcache/
// https://addons.mozilla.org/en-US/firefox/addon/firefox-translations/
// https://addons.mozilla.org/en-US/firefox/addon/german-dictionary-de_de-for-sp/
user_pref("_user.js.parrot", "START");
user_pref("general.warnOnAboutConfig", false);
//// telemetry / reporting
user_pref("toolkit.telemetry.enabled", false);
user_pref("toolkit.telemetry.unified", false);
user_pref("toolkit.telemetry.server", "data:,");
user_pref("toolkit.telemetry.archive.enabled", false);
user_pref("toolkit.telemetry.reportingpolicy.firstRun", false);
user_pref("datareporting.healthreport.uploadEnabled", false);
user_pref("datareporting.healthreport.service.enabled", false);
user_pref("datareporting.policy.dataSubmissionEnabled", false);
user_pref("browser.newtabpage.activity-stream.telemetry", false);
user_pref("browser.newtabpage.activity-stream.feeds.telemetry",false);
user_pref("browser.ping-centre.telemetry", false);
user_pref("browser.chrome.errorReporter.enabled", false);
user_pref("browser.chrome.errorReporter.submitUrl", "");
/// ssl error reporting
user_pref("security.ssl.errorReporting.automatic", false);
user_pref("security.ssl.errorReporting.enabled", false);
user_pref("security.ssl.errorReporting.url", "");
/// addon pings
user_pref("browser.selfsupport.enabled", false);
user_pref("browser.selfsupport.url", "");
/// crashreporting
user_pref("browser.tabs.crashReporting.sendReport", false);
user_pref("breakpad.reportURL", "");
user_pref("browser.tabs.crashReporting.sendReport", false);
user_pref("browser.crashReports.unsubmittedCheck.enabled", false);
user_pref("dom.ipc.plugins.flash.subprocess.crashreporter.enabled", false);
user_pref("dom.ipc.plugins.reportCrashURL", false);
// sends daily pings to Mozilla about extensions and recent startups
user_pref("extensions.getAddons.cache.enabled", false);
// disallow Firefox to make personalized extension recommendations
user_pref("browser.discovery.enabled", false);
/// safebrowsing
user_pref("_user.js.parrot", "safebrowsing");
user_pref("browser.safebrowsing.provider.google.reportURL", "");
user_pref("browser.safebrowsing.reportMalwareMistakeURL", "");
user_pref("browser.safebrowsing.reportPhishMistakeURL", "");
user_pref("browser.safebrowsing.reportPhishURL", "");
//// #fingerprinting
user_pref("_user.js.parrot", "fingerprinting");
// user_pref("privacy.resistFingerprinting", true);
/// #webRTC
//pref("media.peerconnection.enabled", false);
// prevent local ip leaks
user_pref("media.peerconnection.ice.no_host", true);
/// #webGL
//pref("webgl.disabled", true);
//pref("webgl.enable-webgl2", false);
//// #Tracking
user_pref("_user.js.parrot", "Tracking");
//pref("privacy.donottrackheader.enabled", true);
pref("privacy.trackingprotection.enabled", true);
pref("privacy.trackingprotection.pbmode.enabled", true);
user_pref("browser.contentblocking.rejecttrackers.reportBreakage.enabled",false); // disable Lightbulb in AddressBar
user_pref("browser.contentblocking.reportBreakage.enabled",false); // disable Lightbulb in AddressBar
// Disable Onboarding
user_pref("privacy.trackingprotection.ui.enabled", true);
user_pref("privacy.trackingprotection.introCount", 99); // disable intro
user_pref("browser.contentblocking.introCount", 99); // disable intro
//// experiments
user_pref("network.allow-experiments", false);
user_pref("experiments.supported",false);
user_pref("experiments.enabled",false);
user_pref("experiments.manifest.uri", "");
user_pref("app.normandy.enabled", false);
user_pref("app.normandy.api_url", "");
user_pref("extensions.ui.experiment.hidden", true);
user_pref("network.allow-experiments", false);
user_pref("extensions.shield-recipe-client.enabled", false);
user_pref("extensions.shield-recipe-client.api_url", "");
user_pref("app.shield.optoutstudies.enabled", false);
//// Search
user_pref("_user.js.parrot", "Search");
// search settings get ignored but I set them anyway
user_pref("browser.search.selectedEngine", "DuckDuckGo");
user_pref("browser.search.defaultenginename", "DuckDuckGo");
user_pref("browser.search.defaultenginename.US", "DuckDuckGo");
user_pref("browser.search.defaultenginename.DE", "DuckDuckGo");
user_pref("browser.search.defaulturl", "https://start.duckduckgo.com/?q=");
user_pref("browser.search.order.1", "DuckDuckGo");
user_pref("browser.search.hiddenOneOffs","Bing,Amazon.com,eBay,Google,Twitter");
user_pref("browser.search.suggest.enabled", true);
user_pref("browser.search.geoSpecificDefaults", false);
user_pref("browser.search.geoSpecificDefaults.url", "");
user_pref("browser.search.geoip.url", "");
user_pref("browser.search.update", false);
//// urlbar
user_pref("_user.js.parrot", "urlbar");
user_pref("browser.urlbar.oneOffSearches", false); // select search engines as icons
user_pref("browser.urlbar.autocomplete.enabled", true);
user_pref("browser.urlbar.suggest.history", true);
user_pref("browser.urlbar.suggest.bookmark", true);
user_pref("browser.urlbar.suggest.openpage", true);
user_pref("browser.urlbar.suggest.searches", false); //autosuggestions from search provider
user_pref("browser.urlbar.searchSuggestionsChoice", true); // nagging if you want to enable suggest.searches
user_pref("browser.urlbar.filter.javascript", false); // allow bookmarklets to be opened from urlbar
user_pref("browser.urlbar.trimURLs", false); // Don't trim HTTP off of URLs in the address bar.
user_pref("browser.urlbar.autoFill", true);// As you type, entries you have previously typed that closely match appear highlighted after your typed text
user_pref("browser.urlbar.autoFill.typed", true);
//pref("browser.startup.page","https://start.duckduckgo.com");
//pref("browser.startup.homepage","https://start.duckduckgo.com");
//pref("startup.homepage_override_url","https://start.duckduckgo.com");
//pref("startup.homepage_welcome_url","https://start.duckduckgo.com");
user_pref("browser.startup.homepage_override.mstone", "ignore"); // Suppress the "What's new" page
user_pref("browser.aboutHomeSnippets.updateUrl", "data:,");
//// bookmarks can be managed in a single file
//// bookmarks.html template: https://gist.github.com/apfelchips/749b121f27d62d3cef78a45722c5c967
// pref("browser.bookmarks.file", "~/.config/firefox/bookmarks.html"); // has to be symlinked, ff can't write to bookmarks.html when a custom path outside of the profile is used
// user_pref("browser.places.importBookmarksHTML", true); // has to to user_pref to force bookmarks.html import
// user_pref("browser.bookmarks.max_backups", 0); // Bookmark Backups
// user_pref("browser.bookmarks.restore_default_bookmarks", false); // stop adding Default Bookmarks
// user_pref("browser.bookmarks.autoExportHTML", false); // there can only be one exporter or bookmarks.html is managed manually
//// about:newtab
user_pref("_user.js.parrot", "newtab");
user_pref("browser.newtabpage.activity-stream.feeds.section.highlights",false);
user_pref("browser.newtabpage.activity-stream.feeds.section.topstories", false);
user_pref("browser.newtabpage.activity-stream.feeds.snippets", false);
user_pref("browser.newtabpage.activity-stream.showTopSites", true);
user_pref("browser.newtabpage.activity-stream.topSitesCount", 12);
user_pref("browser.newtabpage.activity-stream.migrationExpired", true); // import from other browsers
user_pref("browser.newtabpage.activity-stream.disableSnippets", true);
user_pref("browser.newtabpage.activity-stream.feeds.snippets", false);
user_pref("browser.newtabpage.introShown", true);
user_pref("browser.newtabpage.activity-stream.showSponsored", false);
user_pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false);
user_pref("browser.urlbar.sponsoredTopSites", false);
user_pref("browser.newtabpage.enhanced", false); // "Suggested Articles"
user_pref("browser.newtabpage.directory.source", "data:text/plain,");
user_pref("browser.newtabpage.directory.ping", "data:text/plain,");
user_pref("browser.library.activity-stream.enabled", false);
user_pref("browser.newtabpage.activity-stream.enabled", false);
//// annoyances, tweaks
user_pref("network.IDN_show_punycode", true);
user_pref("devtools.selfxss.count", 42); // allow pasting in dev-console
user_pref("media.autoplay.enabled", false);
user_pref("media.autoplay.enabled.user-gestures-needed", false);
pref("media.autoplay.default", 5); // block audio and video by default
pref("media.play-stand-alone", true);
// always ask for download directory
user_pref("browser.download.useDownloadDir", false);
// permissions 0:Ask / 1:Allow / 2:Don't ask
user_pref("permissions.default.desktop-notification", 2);
user_pref("permissions.default.microphone", 0);
user_pref("permissions.default.camera", 0);
user_pref("permissions.default.geo", 2);
user_pref("permissions.default.xr", 2); //virtual reality
// SYNC
user_pref("services.sync.enabled", false);
user_pref("identity.fxaccounts.enabled", false);
//// #UI / #UX
user_pref("browser.compactmode.show", true); // re-enable Compact Toolbar mode
user_pref("browser.backspace_action", 0); // 0: Go back in history, 1: Page Up, 2: Nothing
user_pref("browser.ctrlTab.previews", false);
user_pref("browser.ctrlTab.recentlyUsedOrder", false);
user_pref("general.autoScroll", true); // Navigation Dot on Middle Click
user_pref("layout.spellcheckDefault", 2); // 0=none, 1-multi-line, 2=multi-line & single-line
// Don't try to guess domain names when entering an invalid domain name in URL bar
user_pref("browser.fixup.alternate.enabled", false);
user_pref("browser.tabs.warnOnClose", false);
user_pref("browser.tabs.warnOnCloseOtherTabs", false);
user_pref("full-screen-api.warning.delay", 0);
user_pref("full-screen-api.warning.timeout", 2500);
// Show Bookmarks Toolbar visibility setting
// user_pref("browser.toolbars.bookmarks.visibility", "newtab");
/// #Startup
user_pref("_user.js.parrot", "Startup");
user_pref("browser.slowStartup.notificationDisabled", true);
user_pref("browser.slowStartup.samples", 0);
user_pref("browser.slowStartup.maxSamples", 0);
user_pref("browser.disableResetPrompt", true);
user_pref("browser.rights.3.shown", true); //don't show EULA
user_pref("browser.shell.checkDefaultBrowser", false);
user_pref("browser.shell.didSkipDefaultBrowserCheckOnFirstRun", true);
//// #Value Added Services
user_pref("_user.js.parrot", "Value Added Services");
user_pref("browser.tabs.firefox-view", false);
user_pref("browser.firefox-view.feature-tour", '{"screen":"","complete":true}');
user_pref("pocket.enabled", false);
user_pref("browser.pocket.enabled", false);
user_pref("extensions.pocket.enabled", false);
user_pref("dom.flyweb.enabled", false); // IoT whatever
user_pref("browser.casting.enabled", false);
user_pref("signon.rememberSignons", false); // Disable Password Manager
user_pref("browser.pagethumbnails.capturing_disabled", true);
user_pref("browser.shell.shortcutFavicons", false);
user_pref("dom.gamepad.enabled", false);
user_pref("dom.vr.enabled", false);
user_pref("dom.vibrator.enabled", false);
// Trusted Recursive Resolver (DNS-over-HTTPS) (disabled)
user_pref("network.trr.mode", 0);
/// #Onboarding | #First Run | #Guides
user_pref("browser.onboarding.enabled", false);
user_pref("browser.onboarding.notification.finished", true);
user_pref("browser.messaging-system.whatsNewPanel.enabled", false); // no more present icon
user_pref("browser.feeds.showFirstRunUI", false);
user_pref("browser.usedOnWindows10", true);
user_pref("browser.usedOnWindows10.introURL", "");
user_pref("datareporting.healthreport.service.firstRun", false);
user_pref("toolkit.telemetry.reportingpolicy.firstRun", false);
user_pref("browser.reader.detectedFirstArticle", false);
user_pref("browser.uitour.enabled", false);
/// #Reccomendation Popups (╯°□°)╯︵ ┻━┻
user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false);
user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false);
user_pref("browser.newtabpage.activity-stream.asrouter.providers.whats-new-panel", false); // Hide Giftbox
///// #Features we want
user_pref("_user.js.parrot", "Features we want");
//// # Screenshot tool
user_pref("extensions.screenshots.disabled", false);
user_pref("extensions.screenshots.system-disabled", false);
user_pref("extensions.screenshots.upload-disabled", true);
///// #Shutdown Cleanup
user_pref("_user.js.parrot", "Shutdown Cleanup");
pref("privacy.clearOnShutdown.history", false);
pref("privacy.clearOnShutdown.sessions", false);
pref("privacy.clearOnShutdown.formdata", false);
pref("privacy.clearOnShutdown.cookies", false); // manage with Cookie AutoDelete extension
pref("privacy.clearOnShutdown.cache", true);
pref("privacy.clearOnShutdown.siteSettings", false);
pref("privacy.clearOnShutdown.downloads", true);
pref("privacy.clearOnShutdown.offlineApps", true);
pref("privacy.clearOnShutdown.openWindows", true);
pref("privacy.sanitize.sanitizeOnShutdown", true);
pref("browser.helperApps.deleteTempFileOnExit", true);
//// #Clear recent history menu defaults
user_pref("_user.js.parrot", "Clear recent history");
pref("privacy.sanitize.timeSpan", 0);
pref("privacy.cpd.history", true);
pref("privacy.cpd.sessions", false);
pref("privacy.cpd.formdata", true);
pref("privacy.cpd.cookies", false); // manage with Cookie Autodelete extension
pref("privacy.cpd.cache", true);
pref("privacy.cpd.siteSettings", false);
pref("privacy.cpd.offlineApps", true);
pref("privacy.cpd.downloads", true);
// #Cookies
pref("network.cookie.cookieBehavior", 5); // 1: allow cookies from originating server only | 5: "smart"
//// #Extensions
user_pref("_user.js.parrot", "Extensions");
//// https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Alternative_distribution_options/Sideloading_add-ons#Installation_using_the_standard_extension_folders
//// https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Alternative_distribution_options/Add-ons_in_the_enterprise#Controlling_automatic_installation
// user_pref("plugin.defaultXpi.state", 2);
// scopes: https://mike.kaply.com/2012/02/21/understanding-add-on-scopes/
// user_pref("extensions.enabledScopes", 1);
// user_pref("extensions.autoDisableScopes", 14);
// user_pref("extensions.update.enabled", true);
// user_pref("extensions.update.autoUpdate", true);
// user_pref("extensions.webextensions.keepStorageOnUninstall", false);
// user_pref("extensions.webextensions.keepUuidOnUninstall", false);
//// #Protocol Handers
user_pref("_user.js.parrot", "Protocol Handlers");
// user_pref("network.protocol-handler.expose-all", false);
// user_pref("network.protocol-handler.warn-external-default", true);
// user_pref("network.protocol-handler.expose.ext+container", true);
// user_pref("network.protocol-handler.external.ext+container", true);
// user_pref("network.protocol-handler.warn-external.ext+container", false);
// user_pref("network.protocol-handler.expose.rdp", true);
// user_pref("network.protocol-handler.external.rdp", true);
// user_pref("network.protocol-handler.warn-external.rdp", true);
// user_pref("network.protocol-handler.expose.vlc", true);
// user_pref("network.protocol-handler.external.vlc", true);
// user_pref("network.protocol-handler.warn-external.vlc", false);
// user_pref("network.protocol-handler.expose.mpv", true);
// user_pref("network.protocol-handler.external.iina", true);
// user_pref("network.protocol-handler.warn-external.mpv", false);
// user_pref("network.protocol-handler.expose.iina", true);
// user_pref("network.protocol-handler.external.iina", true);
// user_pref("network.protocol-handler.warn-external.iina", false);
// #Security | #TLS
user_pref("_user.js.parrot", "Security | TLS");
// kind of fixed by first party isolation -- to prevent HSTS fingerprinting (https://www.privacy-handbuch.de/handbuch_21m.htm)
// rm SiteSecurityServiceState.txt & touch SiteSecurityServiceState.txt && chmod 555 SiteSecurityServiceState.txt
//user_pref("security.mixed_content.block_display_content", true);
//user_pref("security.mixed_content.block_active_content", true);
// pref("security.OCSP.require", true);
// user_pref("security.ssl.enable_ocsp_stapling", true);
/// user_pref("security.ssl.enable_ocsp_must_staple", true);
// user_pref("security.cert_pinning.enforcement_level", 2);
// user_pref("network.stricttransportsecurity.preloadlist", true);
// user_pref("security.pki.sha1_enforcement_level", 1);
// user_pref("security.ssl.treat_unsafe_negotiation_as_broken", true);
user_pref("_user.js.parrot", "FINISHED");
// src: https://gist.github.com/apfelchips/f129c8316055e524774d757365267e26
// Preferences --> Advanced --> General --> Config Editor...
// https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Thunderbird_Configuration_Files
// https://github.com/dngray/ghacks-thunderbird-user.js
// https://github.com/CHEF-KOCH/TBCK
user_pref("_user.js.parrot", "START");
user_pref("general.warnOnAboutConfig", false);
user_pref("calendar.integration.notify", false); //stop asking about Lighting Calendar
user_pref("_user.js.parrot", "COMPOSITION");
user_pref("spellchecker.dictionary","de-DE");
user_pref("mail.compose.big_attachments.notify", false);
user_pref("mailnews.sendformat.auto_downgrade", true); // send plain-text mail if possible
// user_pref("layers.acceleration.disabled",false); // enable hardware acceleration (may be unstable)
user_pref("_user.js.parrot", "ACCOUNT_SETTINGS");
// Server Setup
user_pref("mail.server.server1.login_at_startup", true);
user_pref("mail.server.server1.name", "example@example.com"); // Name used in TB UI
user_pref("mail.server.server1.hostname", "imap.example.com");
user_pref("mail.server.server1.port", 143);
user_pref("mail.server.server1.userName", "imap-username");
user_pref("mail.server.server1.type", "imap");
user_pref("mail.server.server1.socketType", 2); // use STARTTLS
user_pref("mail.smtpservers", "smtp1");
user_pref("mail.smtpserver.smtp1.hostname", "smtp.example.com");
user_pref("mail.smtpserver.smtp1.username", "smtp-username");
user_pref("mail.smtpserver.smtp1.port", 587);
user_pref("mail.smtpserver.smtp1.authMethod", 3);
user_pref("mail.smtpserver.smtp1.try_ssl", 2); // use STARTTLS
// Account Setup
user_pref("mail.accountmanager.accounts", "account1,account2");
user_pref("mail.accountmanager.defaultaccount", "account1");
user_pref("mail.accountmanager.localfoldersserver", "server2");
// Identity Setup
user_pref("mail.identity.id1.fullName", "FirstName LastName");
user_pref("mail.identity.id1.useremail", "example@example.com");
user_pref("mail.identity.id1.valid", true);
user_pref("mail.identity.id1.smtpServer", "smtp1");
user_pref("mail.account.account1.server", "server1");
user_pref("mail.account.account1.identities", "id1");
// filters
user_pref("mailnews.customHeaders", "Delivered-To");
// The file that stores your filter settings is called "msgFilterRules.dat"
user_pref("_user.js.parrot", "TELEMETRY");
pref("toolkit.telemetry.enabled", false);
user_pref("toolkit.telemetry.prompted", 2);
user_pref("toolkit.telemetry.rejected", true);
user_pref("browser.chrome.errorReporter.enabled", false);
user_pref("browser.chrome.errorReporter.submitUrl", "");
user_pref("browser.tabs.crashReporting.sendReport", false);
user_pref("browser.crashReports.unsubmittedCheck.enabled", false);
user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false);
user_pref("_user.js.parrot", "SECURITY");
// user_pref("javascript.enabled", false); breaks stuff / not security relevant anymore
user_pref("mail.chat.enabled", false); // disable chat functionality
user_pref("network.cookie.cookieBehavior", 2); //disable cookies
user_pref("_user.js.parrot", "UI/UX");
// mail search - sort by date
user_pref("gloda.facetview.sortby", 1);
// use maildir instead of mbox https://wiki.mozilla.org/Thunderbird/Maildir
user_pref("mail.serverDefaultStoreContractID", "@mozilla.org/msgstore/maildirstore;1")
user_pref("mailnews.headers.showSender", true);
user_pref("mailnews.headers.showUserAgent", true);
// Always ask you where to save files
user_pref("browser.download.useDownloadDir", false);
user_pref("mailnews.ui.junk.firstuse", false);
user_pref("mail.spam.markAsReadOnSpam", true);
// sort descending by default
user_pref("mailnews.default_news_sort_order", 2);
user_pref("mailnews.default_sort_order", 2);
// https://www.enigmail.net/index.php/en/user-manual/advanced-operations#General_preferences
user_pref("mail.identity.default.enablePEP", false); // disable the PEP clusterfuck
user_pref("_user.js.parrot", "FINISHED");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment