User.js file

From MozillaZine Knowledge Base
Revision as of 16:57, 3 March 2004 by Mmcmonster (talk | contribs)
Jump to navigationJump to search

user.js is a file that contains preferences that will be loaded into the Mozilla Application Suite every time the suite is started up. Each time Mozilla is started up, the valid preferences from user.js are copied into prefs.js, which Mozilla uses to store all the preferences for the current user.

Similar to the user.js file, entering about:config in the URL bar will edit the preferences for the current Mozilla user profile. Changes made in this manner will directly modify the prefs.js file.

Mozilla will never modify the contents of user.js. However, the contents of prefs.js is frequently modified by Mozilla. If you wish do modify prefs.js directly, you should take care to shut down Mozilla completely before you open the file. Otherwise your edits may be overwritten.

The user.js file is located in the same directory as prefs.js. Valid preferences are via the user_pref command, as demonstrated below.

// denotes a comment. Anything after these two characters on a line are ignored.

Following are a number of preferences and what they do. For lack of a better way of ordering them, they are alphabetical via preference name. These can be copied "as-is" into your user.js file.

// Type-Ahead-Find allows the user to search for text or links on a site by just
// typing the search term.
// Find next instance of the search term is <F3>.
// Find previous instance of the search term is <Shift-F3>.
// Turn on Type-Ahead-Find
// Default: true
user_pref("accessibility.typeaheadfind", true);
// Allow type-ahead-find to work on text as well as links by default
// Default: true (Type-Ahead-Find will only work on links)
user_pref("accessibility.typeaheadfind.linksonly", false);
// The address book has a throbber. By default, all throbbers will take the
//    browser window to www.mozilla.org, but this is easy to change.
// Default: "http://www.mozilla.org"
user_pref("addressbook.throbber.url","http://www.google.com");
// Block new windows from opening up.
// Default: false (Allow popups)
user_pref("browser.block.target_new_window", true);
// 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);
// Site icons are icons that show up in the URL bar when visiting a site.
// Favicons are a broken implementation of site icons used by Internet Explorer (IE).
// Web pages are supposed to tell us if they have a site icon.
// Since IE looks for favicons on *all* sites, this causes unnecessary page hits.
// Mozilla can do the same by setting the following preference.
// Look for Favicons (like IE) if not specified
// Default: false
user_pref("browser.chrome.favicons", true);
// Look for site icons if site specifies them
user_pref("browser.chrome.site_icons", true);
// Load icons (favicons/site icons) into the toolbar?
// 0 - No
// 1 - Show icons only if they're cached
// 2 - Always show icons
user_pref("browser.chrome.load_toolbar_icons", 2);
// Keep download status box open after download completes?
// Default: true (Download status box remains open after download finishes)
user_pref("browser.download.progressDnldDialog.keepAlive", false);
// Download manager behavior
//  (0=use download manager, 1=simple dialog, 2=No download manager popup)
user_pref("browser.downloadmanager.behavior", 1);
// Allow images that are too big to be resized.
user_pref("browser.enable_automatic_image_resizing", true);
// The following preferences are to specify tabbed browsing behavior
// Show tabs when only one tab open.
user_pref("browser.tabs.autoHide", false);
// When opening a link in a new tab, the default behavior is to put focus on the
//    new tab.
user_pref("browser.tabs.loadInBackground", true);
// Open a link in a new tab if you 'middle click' on the link. Clicking down on a
//    mouse wheel is concidered a middle click.
user_pref("browser.tabs.opentabfor.middleclick", true);
// Open a new tab if you hit ctrl+<enter> in the URL bar.
user_pref("browser.tabs.opentabfor.urlbar", true);
// If multiple tabs are open and you close the window, the default behaviour is
// to warn you that there are open tabs.  This disables that warning.
user_pref("browser.tabs.warnOnClose", false);
// The browser window has a throbber. By default, all throbbers will take the
//    browser window to www.mozilla.org, but this is easy to change.
user_pref("browser.throbber.url", "http://www.yahoo.com/");
// Show the search button next to the URL line
// Default: true
user_pref("browser.toolbars.showbutton.search", false);