Administering Firefox: pushing browser preferences

This is a guest post from Timothy O’Connell.

This blog is going to end with a question that I have been unable, after countless minutes of Googling, to answer satisfactorily. It will start, however, with some givens.

I already know that if you want to alter the default settings for all profiles that will be created by a given Firefox installation in the future, you add the line for the preference that you want to effect those profiles to the file FIREFOX_ROOT/defaults/profile/prefs.js.

Similarly, I already also know that if you want to push a preference to all currently existing users on the machine, you add the line for that preference to FIREFOX_ROOT/deftauls/pref/firefox.js.

The caveat there, of course, is that if the user of the profile have already changed a preference in his personal prefs.js (i.e. the one in HOMEDIR/.mozilla/firefox/RANDOMALPHANUMERICS.USERNAME/prefs.js) and it conflicts with your preference in the (global) firefox.js, then you (the admin) are SOL, because the program will defer to the user’s personal prefs.js file.

Which brings us to the question: is there a way (short of writing a script to parse individual user’s personal prefs.js files and modify them as needed) to push a preference to all users of a given Firefox installation?

Full disclosure: I’m posing this question for two reasons. The first reason is that I’m sort of passive-aggressive with Firefox: ours is a very love-hate relationship. The second reason is that I honestly don’t think that what I’m describing–i.e. adding a preference to one, “master” preferences file that effects all users of a given installation, regardless of their personal prefs.js file–can be done.

Am I missing something? Maybe even something truly forehead-slap-worthy that’s at the top of all the documentation? Or is this a real limitation of the program?


Published by

Trevor Turk

A chess-playing machine of the late 18th century, promoted as an automaton but later proved a hoax.

One thought on “Administering Firefox: pushing browser preferences”

  1. OK, I'm going to go ahead and answer my own question (with an excerpt from Mozilla's developer site):

    A systems administrator can modify the default preferences in two ways:

    The administrator may edit the all.js default pref file (install_directory/defaults/prefs/all.js). This has the advantage of changing the default value for both new and existing profiles. However, note preferences set in the profile will override the default settings. Also, note due to preferences file compression, some preferences are not saved if they match the default values, causing the profile to behave differently if used in a different installation.

    The administrator may alternatively put a user.js file in app_dir/defaults/profile/ ; this will put a copy of the user.js in all new profiles. This method has the advantage of resetting preferences back to administrator defaults at every start-up. Note that, because a user typically has access privilege to his or her profile directory, he or she can change the default values if he or she knows how. Another disadvantage is that existing profiles will not be affected.

    …and there you have it.

Comments are closed.