Locking preferencesFrom MozillaZine Knowledge BaseThis article describes how to prevent specific settings from being modified from inside Firefox or Mozilla Suite / SeaMonkey. This is commonly known as locking preferences. If you're looking at a larger scale internal solution, you should consider using the Mozilla Client Customization Kit for Firefox, which supports preference locking and much more-- all packaged in an easy to use installer.
[edit] Guide[edit] Determining settings
[edit] Creating the lock file
//
lockPref("network.proxy.type", 0);
[edit] Loading the lock fileFinally, you must modify the all.js file. In Firefox, "all.js" is located in the greprefs subfolder of the application folder. In Mozilla Suite when installed on Windows, "all.js" is located in the greprefs subfolder of C:\Program Files\Common Files\mozilla.org\GRE\<buildID>.
pref("general.config.filename", "mozilla.cfg");
[edit] Optional Steps[edit] Hiding optionsSince these settings can no longer be changed by the user, you may want to prevent them from being shown at all in the GUI. This purely cosmetic change can be done by modifying userChrome.css. [edit] Restricting file accessA user who can modify all.js can obviously remove the lock file reference and change those settings. Revoking write authority from the user for all.js would prevent this. However, it should be noted that doing this may prevent the user from upgrading Firefox in the future, as new major versions may contain changes to this file. [edit] CaveatsSince it is possible to completely bypass locked preferences by running a separate version of Firefox or Mozilla Suite (or a completely different browser) from a different location, it may be necessary to restrict which programs can be run. However, at this point, it is probably a good idea to examine exactly why you are locking the preferences in the first place. If the intent is to protect users from themselves, or to keep novice users from breaking their software, then you have probably done enough. However, if you are trying to secure your network using client-side settings, then you should realize this is very difficult, and ultimately wastes too many resources. Instead, you should probably redirect your efforts to the server/router where you can fight battles that are more easily won. [edit] UndoingTo unlock all preferences, remove the entry you added earlier from the "all.js" file and completely restart Firefox or Mozilla Suite. [edit] External links
|
|