5

For security reasons, we need to "lock" some of the preferences in Mozilla Firefox. We are running Windows XP and the latest version of Mozilla version 14.0.1. In particular some of the security preferences such as Security.ask_for_password. If the user were to do about:config, we would like the particular options to be greyed out so they cannot click on them.

I have read that this can be done by adding the following in:

\Mozilla Firefox\defaults\pref\test.js

preflock("security.enable_ssl3", false);

However, this does nothing.

JMeterX
  • 3,387
  • 16
  • 31

2 Answers2

4

Your file should start with double //, and I think the correct term is lockPref. The correct contents of your file should be;

//
lockPref("security.enable_ssl3", false);

Also, you should save this file in the root of the installation directory and modify local-settings.js to load the file.

pref("general.config.filename", "test.js");
Bart De Vos
  • 17,911
  • 6
  • 63
  • 82
  • Thanks for the help. I tried you way but it didn't seem to take. However, I also tried this: `lock_pref("security.enable_ssl3", false);` and it did set this preference to false. I will also try changing the local-settings.js now. This however, only gets me half way. It sets it as false but does not grey out the option. Any ideas? – JMeterX Aug 10 '12 at 16:01
  • lockPref should lock it, if it isn't locked, your file is not being loaded. – Bart De Vos Aug 10 '12 at 16:04
  • I might be overlooking it but where is the local-settings.js file located?...never thought I would ask such a question. – JMeterX Aug 10 '12 at 16:24
  • I'm on OSX, and I can find it here: `/Applications/Firefox.app/Contents/MacOS/defaults/pref/local-settings.js`, Windows-alternative would be `%PROGRAMFILES%\Mozilla Firefox\defaults\pref\` I suppose. – Bart De Vos Aug 10 '12 at 16:27
  • 1
    Thanks for the help! For windows, You must place `local-settings.js` into `Program Files (x86)\Mozilla Firefox\defaults\pref` (it didn't exist and had to be created) I was missing the value to ensure it would read it as plain text so my `local-settings.js` looks like the following: `pref("general.config.obscure_value", 0); pref("general.config.filename", "thisworks.cfg");` I called `thisworks.cfg` and placed it into the root of Mozilla Firefox install directory as you had said, but I had to use the following markup for it to work `// lockPref("security.enable_ssl3", false);` – JMeterX Aug 10 '12 at 16:59
0

Up to date preference locking for Firefox 63 and Windows 10...

Mozilla Firefox version 63.00 Setup for Locking Files

  1. Open Firefox and type “about:config” into the path bar.

    a. For any preference that is locked you will see the entries in italics and the status displaying “locked”

  2. Create the following as text files and change the extension on each.

    a. mozilla.cfg – lists desired files to be locked.

      i.    The first line is always a double forward slash (//)
     ii.    Starting at the second line, use the lockPref command – examples:
        1.  lockPref("app.update.enabled", false);
        2.  lockPref("security.tls.version.min", 2);
    

    b. local-settings.js – uses mozilla.cfg to lock the preferences.

     i. Add the following entries. Do NOT place a “//” on the first line of the file.
        1.  pref("general.config.filename", "mozilla.cfg");
        2.  pref("general.config.obscure_value", 0);
    

    c. user.js – changes the settings for each of the listed preferences.

     i. Enter the same entries that were in mozilla.cfg but use the “user_pref” 
        command at the beginning of each entry. Do NOT place a “//” on the first line 
        of the file.
        1.  user_pref("app.update.enabled", false);
        2.  user_pref("security.tls.version.min", 2);
    
  3. The folders where mozilla.cfg and local-settings.js files are located have full Administrators and System rights assigned, however to make changes to these files copy them to another folder (i.e. Desktop) then copy it back into its respective folder. The UAC prompt asks to accept the changes. A regular user shouldn’t have rights to do this.

  4. Location is very important for each of the above files. Place each in their respective directories as shown below.

    a. mozilla.cfg is placed into:

    i.  C:\Program Files\Mozilla Firefox
    

    b. Local-settings.js is placed into:

    i.  C:\Program Files\Mozilla Firefox\defaults\pref
    

    c. User.js is placed into:

    i.  C:\Users\”username”\AppData\Roaming\Mozilla\Firefox\Profiles\*this folder 
        name will vary for each installation*
    
  5. To disable the files listed in mozilla.cfg, open the local-setting.js file and add “//” to the beginning of each line to remark them out, save and then restart Firefox. Verify in Firefox under “about:config” that the “locked” status was removed. Of course, to lock them again, remove the “//”.