Locking Mozilla Firefox Settings

Note: If you need assistance on implementing these instructions, ask in the mozilla.support.firefox newsgroup. Not in a comment to this blog post.

Let’s say you are the administrator of one or more installations of Mozilla Firefox and you want to lock certain settings/options, so users cannot edit them. For instance you may want to prevent people from changing the proxy setting, the homepage, the ability to save passwords, etc.

It is possible, but it’s a little complicated.

First you need to find out what the names are of the preferences you wish to lock. The best way to do this is by entering about:config in the Firefox location bar. Every preference that has been used will appear in the resulting list. You can use the filter field to search for preferences that contain certain words. For instance, if you’re looking for the homepage URL setting, just type homepage in the filter field. For more info on preference names, and about:config see:

Next, create a file anywhere on your hard drive, called mozilla.txt. Open mozilla.txt in a text editor (Notepad), and begin the first line with two forward slashes. The following lines will contain the preferences you want to lock, and their values. They should be in the same form as you see them in your profile’s prefs.js file, with one exception: instead of using user_pref, use lockPref. For instance, if you want to lock the proxy at “direct connection“, and lock the homepage at (forgive the ego) http://ilias.ca, the contents of your mozilla.txt file would look like this:
lockPref("network.proxy.type", 0);
lockPref("browser.startup.homepage", "http://ilias.ca/");

Here’s where it gets tricky. The file must be encoded, and renamed. The encoding is a simple “byte-shifting” with an offset of 13. You can download a program that will do this here, or use an online encoder here.

The resulting file should be named mozilla.cfg. Save that in the same directory as firefox.exe.

Last step: In C:\Program Files\Mozilla Firefox\greprefs\ there’s a file called all.js. Open all.js in a text editor, and add the following line at the end of it:
pref("general.config.filename", "mozilla.cfg");

Save, close, and start Firefox to test it.