Firefox – Change some default settings for Firefox globally


Is it possible to modify some of the default settings for Firefox globally?

I know how to change settings for user using about:config. But I would like to have my changes globally, so that any newly created account will inherit my changes.

I have noticed the file /usr/share/iceweasel/browser/defaults/preferences/firefox.js which looks like this might be the place to change settings globally.

Is this the correct way of doing it, or is there a better way? I want to prevent any unintended consequences.

I am using Firefox (Iceweasel) 24.8.1 on Debian.

Best Answer

Yes you can. Mozilla calls this "locking preferences", but I prefer to think of it as "system preferences" (they don't have to be locked).

First, tell Firefox you will be using a system preferences file by creating a text file called local-settings.js in defaults/pref of your Firefox installation directory with these two lines:

pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");

Second, your system preferences file. Create a text file called mozilla.cfg in your Firefox installation directory. The first line must begin with double forward slashes, then add your preferences (the same preferences as found in about:config). An example:

pref("", false);

You have a few options in how you add the preferences:

  • defaultPref - set new default value
  • pref - set pref, but allow changes in current session
  • lockPref - lock pref, disallow changes