FIREFOX BANNER

Firefox user.js Settings and Improvements

Inspired by this post and this comment

  1. Introduction
  2. Memory Optimization
  3. Connection Speed/Responsiveness
  4. Open in New Tab
  5. Disabling Animations/Fullscreen Transitions
  6. Disabling Autofill/Suggestions
  7. Security
  8. Disable Saving Page Thumbnails/Icons
  9. Block Autoplay in Tabs Until Selected
  10. Miscellaneous
  11. Experimental Settings

Some of these settings might already be included on Arkenfox

Memory Optimization

Using memory cache instead of disk cache / limitting media cache / decreasing the frequency of saving the browsing session to disk

1
2
3
4
5
6
7
8
9
user_pref("browser.cache.disk.enable", false);
user_pref("media.cache_size", 256000); // in KB (256MB), default = 512000 (500MB). "File-backed MediaCache size." (stored in memory if disk cache is disabled)
user_pref("media.memory_caches_combined_limit_kb", 256000); // 256MB, default = 524288 (512MB). "Don't create more memory-backed MediaCaches if their combined size would go above this absolute size limit."
user_pref("image.mem.surfacecache.max_size_kb", 256000); // 256MB (Default=2GB). A cache for decoded images (based on the name and other related settings which can be found on https://searchfox.org)
user_pref("browser.sessionstore.interval", 1000000); // (in milliseconds) How often the session is saved to the profile, default=15000=15sec, 300000=5min, 1000000=16min
user_pref("browser.sessionhistory.max_total_viewers", 0); // 0=don't store recently visited pages in the memory

//Deprecated
//Already true by default: user_pref("browser.cache.memory.enable", true);

Connection speed/responsiveness

user_pref("network.buffer.cache.size", 262144); // in bytes. 262144=256KB (You can also try 524288 [=512KB] to see if it works even better) / "the stream buffer segment size used for most network activity." (http://forums.mozillazine.org/viewtopic.php?f=7&t=2416193) / "the default setting is 32 kB, and that corresponds with the buffer size of very old TCP/IP stacks." (https://www.mail-archive.com/support-seamonkey@lists.mozilla.org/msg74561.html) (note "buffer.cache"="segment" https://bugzilla.mozilla.org/show_bug.cgi?id=715770#c1)
user_pref("network.buffer.cache.count", 128); // https://www.mail-archive.com/support-seamonkey@lists.mozilla.org/msg74561.html
user_pref("network.http.max-connections", 1800); // default=900
user_pref("network.http.max-connections-per-server", 32); // might not be used anymore, there's no result for it in searchfox.com (last default might have been 15) https://kb.mozillazine.org/Network.http.max-connections-per-server
user_pref("network.http.max-persistent-connections-per-server", 12); // default=6
user_pref("network.http.max-urgent-start-excessive-connections-per-host", 10); // default=3. "Number of connections that we can open beyond the standard parallelism limit defined by max-persistent-connections-per-server/-proxy to handle urgent-start marked requests"
user_pref("network.http.pacing.requests.burst", 32); // default=10, controls how many HTTP requests are sent at once
user_pref("network.http.pacing.requests.min-parallelism", 10); // default=6. "Min-Parallelism is the amount of active connections that have to be in use in order for the rate limiter to be used" (https://bugzilla.mozilla.org/show_bug.cgi?id=819734#c1)
user_pref("network.websocket.max-connections", 400); // default=200. "Most communication between web browsers and web sites uses HTTP. With HTTP, the client sends a request and the server returns a response. Typically, the response occurs immediately, and the transaction is complete. Even if the network connection stays open, this will be used for a separate transaction of a request and a response. Some modern web sites use WebSockets. WebSocket connections are initiated over HTTP and are typically long-lived. Messages can be sent in either direction at any time and are not transactional in nature. The connection will normally stay open and idle until either the client or the server is ready to send a message."
user_pref("network.ssl_tokens_cache_capacity", 32768); // more TLS token caching (fast reconnects)
// also see "security.pki.crlite_mode" and "browser.cache.memory.capacity"

Open in new tab:

1
2
3
4
5
user_pref("browser.link.open_newwindow.restriction", 0); // 0 = apply the setting under "browser.link.open_newwindow" to ALL new windows (even script windows with features)
user_pref("browser.link.open_newwindow.override.external", 3); // 3 = open external links (from outside Firefox) in a new tab
user_pref("browser.tabs.insertAfterCurrent", true); // Open new tabs next to the current tab
user_pref("browser.tabs.loadBookmarksInTabs", true); // Load bookmarks in tabs
user_pref("browser.urlbar.openintab", true); // Open URL bar entries in a new tab

Disabling animations/fullscreen transitions:

// Cosmetic animations preferences
user_pref("toolkit.cosmeticAnimations.enabled", false); // Disable cosmetic animations
// Note: browser.fullscreen.animate is part of this now https://bugzilla.mozilla.org/show_bug.cgi?id=1466658#c0

// Reduced motion preference
user_pref("ui.prefersReducedMotion", 1); // Enable reduced motion

// Full-screen warning preferences
user_pref("full-screen-api.warning.delay", 50); // Set delay for the full-screen warning popup
user_pref("full-screen-api.warning.timeout", 50); // Set timeout for the full-screen warning popup

// Full-screen transition preferences
user_pref("full-screen-api.transition-duration.enter", 0); // Set transition duration for entering full-screen mode
user_pref("full-screen-api.transition-duration.leave", 0); // Set transition duration for leaving full-screen mode
user_pref("full-screen-api.transition.timeout", 0); // Set transition timeout for full-screen mode

Disabling autofill/suggestions

1
2
3
4
5
6
7
8
9
// URL bar autofill preferences
user_pref("browser.urlbar.autoFill", false); // Disable autofill in the URL bar

// Form autofill preferences
user_pref("browser.formautofill.enabled", false); // Disable form autofill
user_pref("browser.formfill.enable", false); // Disable form fill

// Search suggestion preferences
user_pref("browser.search.suggest.enabled", false); // Disable search suggestions

Security:

user_pref("dom.security.https_only_mode", true); // "if HTTPS-Only Mode is enabled, then Firefox will upgrade all connections to HTTPS." / "When the top-level is HTTPS, insecure subresources are also upgraded (silent fail)"
user_pref("dom.security.https_only_mode_send_http_background_request", false); // disable HTTP background requests - When attempting to upgrade, if the server doesn't respond within 3 seconds, Firefox sends a top-level HTTP request without path in order to check if the server supports HTTPS or not. This is done to avoid waiting for a timeout which takes 90 seconds
user_pref("security.mixed_content.block_active_content", true); // disable insecure active content on https pages (mixed content) (might not be needed with HTTPS-Only Mode enabled)
user_pref("security.mixed_content.block_display_content", true); // disable insecure passive content (such as images) on https pages, "Parts of this page are not secure (such as images)"
user_pref("security.mixed_content.upgrade_display_content", true); // Try to load HTTP content as HTTPS (in mixed content pages)
user_pref("network.auth.subresource-http-auth-allow", 1); // limit (or disable) HTTP authentication credentials dialogs triggered by sub-resources. Hardens against potential credentials phishing
user_pref("browser.xul.error_pages.expert_bad_cert", true); // display advanced information on Insecure Connection warning pages
user_pref("security.dialog_enable_delay", 700); // enforce a security delay on some confirmation dialogs such as install, open/save
user_pref("security.insecure_field_warning.contextual.enabled", true); // Show in-content login form warning UI for insecure login fields
user_pref("security.insecure_password.ui.enabled", true); // show a warning that a login form is delivered via HTTP (a security risk)
user_pref("security.ssl.require_safe_negotiation", true); // Blocks connections to servers that don't support RFC 5746 as they're potentially vulnerable to a MiTM attack
user_pref("security.pki.crlite_mode", 2); // switching from OCSP to CRLite for checking sites certificates which has compression, is faster, and more private. 2="CRLite will enforce revocations in the CRLite filter, but still use OCSP if the CRLite filter does not indicate a revocation" (https://www.reddit.com/r/firefox/comments/wesya4/danger_of_disabling_query_ocsp_option_in_firefox/, https://blog.mozilla.org/security/2020/01/09/crlite-part-2-end-to-end-design/)
user_pref("security.cert_pinning.enforcement_level", 2); // 2=strict. Public key pinning prevents man-in-the-middle attacks due to rogue CAs [certificate authorities] not on the site's list

Disable saving page thumbnails/icons:

1
2
3
user_pref("browser.pagethumbnails.capturing_disabled", true); // Disable capturing of page thumbnails
user_pref("pageThumbs.enabled", false); // Disable the display of page thumbnails
user_pref("browser.shell.shortcutFavicons", false); // URL shortcut files use a cached .ico file (randomly named) which is stored in your profile/shortcutCache directory. The .ico remains after the shortcut is deleted. If set to false then the shortcuts use a generic Firefox icon

Block autoplay in tabs until selected:

1
2
3
user_pref("media.block-autoplay-until-in-foreground", true); // Block autoplay until the tab is in the foreground
user_pref("media.block-play-until-document-interaction", true); // Block media play until user interacts with the document
user_pref("media.block-play-until-visible", true); // Block media play until the content is visible on the screen

Misc:

// Image decoding preferences
user_pref("image.mem.decode_bytes_at_a_time", 65536); // The speed of processing images
user_pref("image.http.accept", "*/*"); // Remove webp as the default image format. Default = "image/webp,*/*"

// Layout and word selection preferences
user_pref("layout.word_select.eat_space_to_next_word", false); // Don't select the space next to a word when selecting a word

// Browser navigation preferences
user_pref("browser.backspace_action", 0); // Restore/enable backspace to return to the previous page
user_pref("browser.translations.enable", false); // Disable "translate this page" that appears when a foreign language is detected
user_pref("browser.warnOnQuit", true); // Warn when quitting the browser
user_pref("browser.tabs.warnOnClose", true); // Warn when closing multiple tabs

// Tab preferences
user_pref("browser.tabs.closeWindowWithLastTab", false); // Prevents the window from closing when the last tab is closed

// URL bar preferences
user_pref("browser.urlbar.openViewOnFocus", false); // Disable address bar popping out

// Download preferences
user_pref("browser.download.open_pdf_attachments_inline", true); // Open PDFs instead of downloading them

// Deprecated
// Already true by default: user_pref("gfx.webrender.all", true); // Enable WebRender to use the GPU instead of the CPU (Software)

Experimental:

Enabling Oblivious DoH (ODoH) for enhanced DNS privacy.

What is Oblivious DoH (ODoH)?

The ODoH implementation is currently experimental so you will need to be prepared for bugs. If you want to test it, change the following settings to set your resolver to Cloudflare and your proxy to SURF (located in the Netherlands).

1
2
3
4
5
6
7
// Trusted Recursive Resolver (TRR) preferences with Oblivious DNS-over-HTTPS (ODoH)
user_pref("network.trr.mode", 3); // Enable DNS-over-HTTPS (DoH) and use ODoH
user_pref("network.trr.odoh.enabled", true); // Enable Oblivious DNS-over-HTTPS (ODoH)
user_pref("network.trr.odoh.configs_uri", "https://odoh.cloudflare-dns.com/.well-known/odohconfigs"); // ODoH configuration URI
user_pref("network.trr.odoh.target_host", "https://odoh.cloudflare-dns.com/"); // ODoH target host
user_pref("network.trr.odoh.target_path", "dns-query"); // ODoH target path
user_pref("network.trr.odoh.proxy_uri", "https://odoh1.surfdomeinen.nl/proxy"); // ODoH proxy URI

You can see it working by visiting about:telemetry#search=odoh which will show a success count (HTTP_CHANNEL_ONSTART_SUCCESS_ODOH) and how much slower it is (DNS_ODOH_LOOKUP_TIME). The proxy IP address will be a permanent fixture in about:networking#sockets. You will see much less cloudflare-dns.com traffic compared with DoH, only connecting periodically to get new configs.

Edit Report
Pub: 15 Dec 2023 16:01 UTC
Edit: 28 Dec 2023 16:49 UTC
Views: 286