Firefox - Editing Configuration Files

There are three files that you should know about: user.js Used to change various preferences. userChrome.css Used to change the appearance of the browser. userContent.css Used to change the appearance of web pages. All these files are plain text files stored in your profile folder and can be edited using a standard text editor, such […]

There are three files that you should know about:

user.js
Used to change various preferences.
userChrome.css
Used to change the appearance of the browser.
userContent.css
Used to change the appearance of web pages.

All these files are plain text files stored in your profile folder and can be edited using a standard text editor, such as Notepad or Texturizer on Windows and gedit or kate on Linux.

Locate your profile folder

Before the configuration files are presented, you should know how to find your profile folder, which is where Firefox saves all your settings on your hard drive.

  • On Windows XP/2000, the path is usually %AppData%\Mozilla\Firefox\Profiles\<var>xxxxxxxx</var>.default\, where xxxxxxxx is a random string of 8 characters. Just browse to C:\Documents and Settings\<var>[User Name]</var>\Application Data\Mozilla\Firefox\Profiles\ and the rest should be obvious.
  • On Windows 95/98/Me, the path is usually C:\WINDOWS\Application Data\Mozilla\Firefox\Profiles\<var>xxxxxxxx</var>.default\
  • On Linux, the path is usually ~/.mozilla/firefox/<var>xxxxxxxx</var>.default/
  • On Mac OS X, the path is usually ~/Library/Application Support/Firefox/Profiles/<var>xxxxxxxx</var>.default/

%AppData% is a shorthand for the Application Data path on Windows 2000/XP. To use it, click Start > Run..., enter %AppData% and press Enter. You will be taken to the "real" folder, which is normally C:\Documents and Settings\<var>[User Name]</var>\Application Data.

Firefox is capable of handling more than one user and thus, more than one profile. The path examples above refers to the default profile that is automatically created when you start Firefox for the first time. You can manage any number of profiles by using the Profile Manager.

user.js

This is the main preferences file for Firefox and is located in you profile folder. The file does not exist by default, so you need to create it before you can start adding your preferences.

Windows users: If you know how to create a file, just skip this section. Before you can create the file, you must make sure that you can see the file type extensions in Windows. Start Explorer (just click on the My Computer icon on your desktop) and select Tools > Folder Options.... Click the View tab and uncheck the Hide extensions for known file types option. Now, go to your profile folder and select File > New > Text Document. The default name New Text Document.txt should be displayed. Change the name to user.js (click Yes on the file type warning that appears).

Linux users: I assume that you know how to create a file if you're running Linux. Just create user.js in your profile folder.

It's also possible to edit the preferences normally stored in user.js by entering about:config in the address bar and press Enter. You will see a list of all available preferences in Firefox (many of them are derived from Mozilla and are not used but not yet removed). Double-click on a preference to change its value. The changes you make here will be immediately stored in prefs.js, which is a file automatically generated by Firefox.

userChrome.css

This file sets the display rules for various elements in the Firefox user interface and is located in the sub-folder called chrome in your profile folder. As with user.js, this file does not exist by default, so you need to create it before you can start adding your preferences. There's actually an example file that exists by default, called userChrome-example.css. Basically, you can just rename that file by removing the -example part.

userContent.css

This file sets the display rules for web content and is located in the sub-folder called chrome in your profile folder. As with user.js, this file does not exist by default, so you need to create it before you can start adding your preferences. As with userChrome.css, there is an example file that exists by default, called userContent-example.css. Basically, you can just rename that file by removing the -example part.