Doing Some Firefox Configuration Spring Cleaning
The Firefox configuration file contains entries for core Firefox settings and extension settings. Most users know that it is possible to modify or add settings by typing about:config in the Firefox address bar. While the entries can be edited there, they can not be deleted.
The file tends to grow over time, largely because entries from uninstalled extensions do not get deleted during removal. Users who install and uninstall add-ons regularly may have a configuration file that is multiple times larger than the standard file.
That's usually not a problem, a large file might prolong the startup of the web browser by a bit though. Privacy is another issue as some extensions record visits pages or specific rules for websites in the preferences.
The preferences are stored in the prefs.js file in the Firefox user profile directory. You can locate it easily by loading about:support in Firefox's address bar. There you find an option to open the profile folder near the top of the page.
It is recommended to create a backup before making any changes to the file so that you can restore it if the need arises. Firefox needs to be closed before editing the prefs.js file as it is automatically saved when it is closed.
Each parameter is stored in a separate line. Many extensions use user_pref("extensions. in the beginning which makes identification easy, some however start directly with their own name.
The only viable option is to go through the configuration file and locate the extensions that are not installed anymore.
That's a tedious process but the only option at hand as there is no automation of the process available. A rule of thumb is to leave entries alone if they cannot be linked directly to extensions that have been uninstalled.
The size of the prefs.js file on the test system was 167 Kilobytes before spring cleaning. The first cleanup brought the file size down to 88 Kilobytes with room for more after some research.
Here are a few tips:
- It helps to have the names of the installed extensions and, if applicable, userscripts at hand.
- Parameters beginning with browser., dom., print. and .network refer to core browser preferences.
- If you are not sure about a specific setting do the following: Create a backup first, make the changes then and test Firefox to see if the functionality is still there. If you encounter errors restore the backup.
And this is how you delete about:config entries in Firefox.
It is really strange that no one ever build a Firefox preference cleaner that automatically removes old entries from the Firefox configuration file or that the developers have build that feature into the browser. How big is your file? Let us know in the comments.
Indeed. I’ve noticed that quite often that when extensions are removed, are removed as well their prefs.js settings when these have not been modified (default). I agree garbage is a pain, and best is to clean prefs.js as soon as an extension is removed (obvious), which still then remains harassing when the values are not namely related to the extension … At this time, our prefs.js is 71,795 bytes for 78 extensions, result of per extension removal cleanup: worth it.
I look up most of my about:config settings in http://kb.mozillazine.org/Firefox_:_FAQs_:_About:config_Entries
While the list is not comprehensive, it feels safer to check first before removing any preferences.
On the other hand, if there are any preferences linked to uninstalled extensions I usually don’t hesitate to remove them.
34 addons, pref.js is 67kb… I’m not going to bother to do cleanup.
23 add-ons, size of Pref.js is 21.6kb.
Hello! Mine is 69.9kb I run Firefox portable on a USB key with a bunch of dev plugins. I hav 32 active addons and 17 disabled addons.
lol, my prefs.js up to 7 MB
ah, i notice it left over grease monkeys scripts and invalid extension too…
since i am rarely tweaking firefox config, is it safe that i am just delete it,
let firefox makes a new one..
Deleting is not an option as you might delete settings of installed extensions.
great article in the autumn :) but the link to the prefs cleaner is tough too (and the thing i looked for)!
my prefs has a size of 3700 KB! but i am using firefox with same profile since the beginnings :)
There is no proof that cleaning up this file has any impact on the performance of Firefox. =)
Great article, will try your method.
My prefs.js is 376kb and I keep upgrading my profile since Netscape 3.0 Gold, so I decided to clean it up after 10+ years :)