Firefox Config Files You Can Edit for Hacks
In this article
This list covers the key files and folders inside a Firefox profile that power users can edit to tweak behavior, enable hidden features, and fix annoyances. It's for anyone comfortable with a text editor and willing to back up files before changing them. Each entry explains what the file does and why it's worth hacking.
user.js
The user.js file sits in your profile folder and lets you set Firefox preferences on every startup. It overrides any changes made in about:config, which makes it perfect for enforcing settings across sessions or after updates. You can add lines like user_pref("browser.tabs.warnOnClose", false); to disable warnings permanently. It's the most powerful single file because it can control thousands of hidden preferences.
prefs.js
This file stores your current preferences and is rewritten by Firefox every time you close it. Editing it directly is risky because Firefox may overwrite your changes, but it's useful for quickly copying settings to another profile. You can also delete it to reset all preferences to defaults—just back it up first. For most hacks, you're better off using user.js instead.
chrome/userChrome.css
This CSS file changes the look of Firefox's interface—toolbars, tabs, menus, and buttons. You can hide the tab bar, move the address bar, or make the UI more compact. To enable it, set toolkit.legacyUserProfileCustomizations.stylesheets to true in about:config. It's the go-to for visual tweaks that about:config can't do.
chrome/userContent.css
This file styles web pages and internal pages like about:newtab and about:home. You can change fonts, colors, or hide elements on specific sites using URL rules. For example, you can make the new tab page darker or remove the search bar. It's useful for a consistent browsing experience across sites.
extensions.json
This file lists all installed extensions and their settings. Editing it can let you enable or disable extensions manually, or change their internal IDs. It's rarely edited directly because the Add-ons Manager does the job, but it's useful for troubleshooting when an extension won't uninstall or when you want to clone extensions to another profile. Always close Firefox before touching it.
sessionstore.jsonlz4
This compressed file saves your open tabs and window state for session restore. You can delete it to force a fresh start, but you can also extract and edit it to recover lost tabs. It's in Mozilla's lz4 format, so you need a tool like lz4json to decompress it. For most users, the built-in restore feature is enough, but this file is a goldmine for data recovery.
places.sqlite
This SQLite database stores your bookmarks, browsing history, and download history. You can open it with a SQLite browser to export or delete specific entries, or to fix corruption. For example, you can remove a single bookmark without using the UI, or clear history for a specific site. Always back it up before editing, as mistakes can break your profile.
permissions.sqlite
This database holds site permissions like camera, microphone, notifications, and pop-up blocks. Editing it lets you grant or revoke permissions in bulk, or copy permissions from one site to another. It's useful for privacy—you can remove all stored permissions at once. Use a SQLite editor and close Firefox first.
handlers.json
This file maps file types and protocols to applications. You can edit it to change how Firefox handles PDFs, mailto links, or custom protocols. It's handy when the Settings UI doesn't offer the option you need. For instance, you can force all PDFs to download instead of opening in the built-in viewer.
policies.json
This file lives in the installation directory (not the profile) and is used by Firefox for Enterprise to enforce policies. You can set it to disable updates, block extensions, or force a homepage. It's a powerful way to lock down Firefox for shared or kiosk setups. The file must be in a distribution folder next to the Firefox executable.
How to Choose
Start with user.js for any preference tweak—it's safe, reversible, and easy to maintain. Use userChrome.css for visual changes and userContent.css for page styling. Only edit SQLite databases like places.sqlite if you're comfortable with backups and know what you're doing. For system-wide control, policies.json is the way. Always back up your profile folder before editing any file, and test changes one at a time.
Frequently Asked Questions
Is editing these files safe?
It's safe if you back up your profile first and only change one thing at a time. Mistakes can cause Firefox to crash or reset, but you can restore from backup.
Where is my profile folder?
Type about:profiles in Firefox and look for the root directory path. On Windows it's usually %APPDATA%\Mozilla\Firefox\Profiles\, on macOS ~/Library/Application Support/Firefox/Profiles/, and on Linux ~/.mozilla/firefox/.
Will Firefox overwrite my user.js changes?
No, user.js is read at startup and applies settings after Firefox loads. It's designed to override existing preferences.
Can I edit prefs.js while Firefox is running?
No, Firefox writes to prefs.js on shutdown, so your edits would be lost. Always close Firefox before editing it.
How do I make userChrome.css work?
Set toolkit.legacyUserProfileCustomizations.stylesheets to true in about:config, then create the chrome folder in your profile and place the CSS file there. Restart Firefox.
Can I reset everything by deleting these files?
Yes, but you'll lose bookmarks, passwords, and settings. Use the Refresh feature in about:support instead, which keeps your data while resetting preferences.
Final Thoughts
These files give you deep control over Firefox, from hidden preferences to UI overhauls. Start with user.js and userChrome.css—they're the most versatile and least risky. Always keep backups, and you'll be able to experiment freely without fear of breaking your browser.