User.js file

From MozillaZine Knowledge Base
Revision as of 16:34, 29 August 2005 by Np (talk | contribs) (make it apply to all apps, redirect pref-specific info to about:config entries article, clean up)
Jump to navigationJump to search

user.js is a file in your profile directory that contains preferences that will be loaded into Firefox/Thunderbird/Mozilla Suite every time it is started up. user.js is useful for making many preference changes at once; for small changes, about:config will probably be easier. The valid preferences in user.js are copied into prefs.js, which is used to store all the preferences for the current user. Firefox/Thunderbird/Mozilla Suite will never modify the contents of user.js.

Changing entries

If user.js does not exist in your profile directory, create it. You can use a text editor to make changes.

Valid preferences are done via the user_pref command, as demonstrated below. // denotes a comment, so anything after these two characters on a line are ignored.

// IE Favorites (bookmarks) are imported the first time Mozilla is run.
// This preference is to determine whether they are shown in the bookmarks menu
// Default: true (Show IE Favorites under bookmarks)
user_pref("browser.bookmarks.import_system_favorites", false);

To undo preferences that you set using the user.js file, you cannot simply delete the preferences that you inserted previously into user.js, as these will remain written in prefs.js. You should instead delete the preferences from prefs.js by editing that file with a text editor or via about:config.

For a list of valid preferences, consult the about:config Entries article.