Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An overview of Mozilla preference files Web Browsers

You can pre-configure Mozilla so that all users get the same preferences when they create a new profile. For example, you might want to define a preference for /tmp, or /Users/Shared as the cache directory, so that users with network home directories will use the local drive for cache.  These prefs are stored in a javascript file called user.js which needs to be saved to /Applications -> Mozilla.app (control-click and select "Show Package Contents") -> Contents -> MacOS -> defaults -> profile -> US -> user.js. In your user.js file, lines which begin // are comments, so you could enter, for example:

//
// user.js: Personal prefs which mozilla shouldn't overwrite.
//
user_pref("browser.startup.homepage", "http://www.my.server.edu/");
user_pref("intl.accept_languages", "en-au, en, en-us, zh, zh-cn, zh-hk, zh-sg, zh-tw, fr, de, de-de, de-at, it, ja, pl, ru, es, sv, fi, sr, hr, da, nl, fr-ca, fr-fr, id, in");
user_pref("intl.charset.default", "UTF-7");

Note that user.js has unix line endings, so use a command line text editor, like vi or pico for editing ... or use BBEdit with the appropriate setting.

For the sake of completeness, I've got the same file at /Applications -> Mozilla.app -> Contents -> MacOS -> defaults -> profile -> user.js, which is where it should be, except that the version I downloaded from mozilla.org turned out to be a US build.

Whenever a new profile is created, a copy of user.js is automatically written to ~/Library -> Mozilla -> Profiles -> profile_name -> randomString.slt -> user.js. When Mozilla runs, it reads its preferences first from that profile, and lastly from the application directory:

  1. ~/Library -> Mozilla -> Profiles -> profile_Name -> randomString.slt -> prefs.js -- stored from last session
  2. ~/Library -> Mozilla -> Profiles -> profile_Name -> randomString.slt -> user.js -- persistent prefs
  3. /Applications -> Mozilla.app -> Contents -> MacOS -> defaults -> pref -> all.js -- persistent admin prefs
prefs.js is re-created by the application every time it runs. user.js is persistent and overwrites prefs.js at launch time. A savvy user could edit user.js or delete it altogether. Then all.js is the last to load and overwrites all the others. You can hack all.js to force preferences on everyone (including existing profiles), or reduce Mozilla to jelly if you are not careful.

I set up Mozilla so the preferences were as I wanted, then quit. Next I copied the lines I wanted from prefs.js to my own user.js file. Then I saved user.js to /Applications -> Mozilla.app -> Contents -> MacOS -> defaults -> profile -> US -> user.js, so that everyone would get these prefs whenever they created a new profile.

You can read more documentation in mozilla.org's A Brief Guide to Mozilla+Netscape Preferences.

    •    
  • Currently 3.50 / 5
  You rated: 4 / 5 (4 votes cast)
 
[5,066 views]  

An overview of Mozilla preference files | 2 comments | Create New Account
Click here to return to the 'An overview of Mozilla preference files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An overview of Mozilla preference files
Authored by: ega on Sep 15, '03 02:18:30PM

So I can make some of these things work but specifically I can not change the cache folder for more than one user. Seems to be encoded on macosx.



[ Reply to This | # ]
An overview of Mozilla preference files
Authored by: RatsoBaggins on Sep 17, '03 09:15:14PM
I have tried to prevent printing of the automatic header & footer in mozilla for OSX by editing all.js and placing these lines in user.js

pref("print.print_headerleft", ""); pref("print.print_headercenter", ""); pref("print.print_headerright", ""); pref("print.print_footerleft", ""); pref("print.print_footercenter", ""); pref("print.print_footerright", "");

But it does not change anything?

Does anyone know how to not print the headers in moz?

[ Reply to This | # ]