Skip to content
Chris Ilias

I still dream of Organon

Chris Ilias

I still dream of Organon

  • Home
  • Portfolio
  • Home
  • Portfolio
Close

Search

  • About
Subscribe
Chris Ilias

I still dream of Organon

Chris Ilias

I still dream of Organon

  • Home
  • Portfolio
  • Home
  • Portfolio
Close

Search

  • About
Subscribe
Home/Mozilla/Firefox/Locking Mozilla Firefox Settings
FirefoxMozilla

Locking Mozilla Firefox Settings

By Chris Ilias
March 26, 2005 2 Min Read
47


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:
http://kb.mozillazine.org/About:config

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.

Author

Chris Ilias

Follow Me
Other Articles
Previous

On Hiatus

Next

Choosing my new RSS reader

47 Comments
  1. Jeff G. says:
    March 26, 2005 at 11:23 am

    Good job on that, Chris, well written.

  2. Anonymous says:
    March 28, 2005 at 11:19 am

    Worked great! You da man.

  3. Anonymous says:
    March 31, 2005 at 6:58 am

    Thank you Chris! Your blog saved our day ๐Ÿ™‚

  4. Anonymous says:
    April 13, 2005 at 8:28 pm

    Chris, I looked all over to find how to do that, so i’m not sure how you figured it out. But thanxs as it gives us a working solution to our problem. Good work

  5. Anonymous says:
    April 13, 2005 at 8:29 pm

    Chris, I looked all over to find how to do that, so i’m not sure how you figured it out. But thanxs as it gives us a working solution to our problem. Good work

  6. Anonymous says:
    June 10, 2005 at 2:12 am

    Chris,

    Thanks for the great info – it plugs a gaping hole in Firefox. My problem is that I’m using Mac OS X, so the solution is not an exact fit. While there is still the Mozilla “prefs.js” file on OS X, the path to saving in the same file as Firefox.exe, etc., just don’t work. I can create a .rtf file with the amended prefs.js language and convert it via the web converter, but I’m pretty much lost at that point. Any thoughts? There just has to be a way to lock this proxy use down in Firefox for OS X!

  7. Anonymous says:
    July 7, 2005 at 11:29 am

    this didnt work for me.
    i went to the site that is linked with the online byteshifter and they say there is a file called profiles.ini in the mozilla firefox folder and there isnt. what am i missing there? also after trying your little fix to lock it down, i came upon an error of some sort, the browser didnt keep any security features i wanted and the url text box wouldnt show the url.

  8. Josh says:
    July 15, 2005 at 1:45 pm

    OK, so I figured out how to use this method on Mac OS X. Basically, it is the same, but instead of saving the mozilla.cfg file to C:Program FilesMozilla Firefox you need to go to wherever your Firefox program icon is (probably in your Applications folder), right-click (or command-click) it and select ‘Show Package Contents’. The greprefs folder which contains the all.js file to be edited is also here.

    Let me know by email (see my Blogger profile) if this doesn’t work for you.

  9. Anonymous says:
    August 9, 2005 at 8:27 pm

    So how would you disable this feature if you didn’t know where the file was?

  10. robsta says:
    August 9, 2005 at 11:29 pm

    Thanks Chris, I’ve been looking for something similar to this for ages. This is going to be really useful.

  11. Josh says:
    August 22, 2005 at 11:54 am

    I left out one key thing from the Mac solution above. The mozilla.cfg file MUST be int he top-level of the application package for this to work…

  12. Karg says:
    August 24, 2005 at 2:13 am

    Works just great! Thanks!

  13. Anonymous says:
    August 25, 2005 at 1:58 pm

    To be precise, the mozilla.cfg file MUST reside in the FireFox.app/Contents/MacOS directory.

  14. Anonymous says:
    September 15, 2005 at 3:12 am

    Thanks m8 it worked for me ๐Ÿ™‚
    looking for more stuffs like this ๐Ÿ™‚

    Lord

  15. Anonymous says:
    September 26, 2005 at 9:24 am

    WOooooooooooow

    You guys r great!!!!!!!!!!!!!!

  16. Anonymous says:
    September 29, 2005 at 11:48 am

    Thank you very much this has helped us a great deal. But there is one preference that we cannot get to lock. It’s in the tabbed browsing section, open external links in a new window.
    This is the statement that we have in mozilla.cfg
    lockPref(“browserlink.open_external”,2);
    Any ideas? Thanks in advance, Laurie

  17. Chris Ilias says:
    September 30, 2005 at 9:46 am

    Anonymous said…
    …there is one preference that we cannot get to lock.
    …
    lockPref(“browserlink.open_external”,2);

    You’re missing a period in the preference line, between browser and link.
    lockPref(“browser.link.open_external”, 2);

    Any questions should be posted in the Firefox newsgroup.

  18. Anonymous says:
    December 8, 2005 at 6:32 pm

    The all.js file changes sifnifigantly in version 1.5 you can re-use the mozilla.cfg file but start with a fresh all.js and add the relevant lines again.

  19. Anonymous says:
    December 8, 2005 at 10:44 pm

    Hi Chris,

    I tried but its not working out for me. I am using FF ver. 1.5 and Windows 2003 OS. I followed all the instructions as is. But still I’m unable to do it. please I need further instructions.

    Thanks in advance,

    Vinay

  20. Anonymous says:
    December 22, 2005 at 12:19 pm

    I almost scrapped Firefox at my district because I was unable to lock down settings….thanks!

    Melinda

  21. CCase says:
    January 6, 2006 at 11:42 am

    Chris,
    I got this to work on with XP OS but not with 98se. What am I doing wrong? Thanks for the help.
    CCase

  22. Anonymous says:
    January 17, 2006 at 4:47 pm

    thanks this gave me a good reason to just do something to by bro who is IT but still can figure this out

  23. Anonymous says:
    January 19, 2006 at 9:13 am

    Can you post the changes to make to all.js for FF1.5 to work the lockpref.

  24. twinprism says:
    February 3, 2006 at 1:19 am

    Works fine with Firefox 1.5, if you re-add the pref statement to all.js

    One thing that got me for a moment, watch the difference between
    user_pref and lockPref
    make sure to remove the underscore if you set options and then copy from prefs.js

  25. Anonymous says:
    February 3, 2006 at 4:28 pm

    Its working GREAT for me except for the following code.

    lockPref(“network.proxy.http”, 207.75.214.7);

    Any ideas?

  26. Mark Ferguson says:
    February 8, 2006 at 2:42 pm

    Chris:

    Can this method work on different OS X accounts? I want to use it on a student account, but not on admin. Thanks.
    Mark Ferguson
    mferguson2@cherrycreekschools.org

  27. Anonymous says:
    February 17, 2006 at 4:19 am

    It works great for the administrator account; but I get the message “Cannot locate the configuration file” when using a limited account under Windows XP. Any suggestions? I’m sure there is a solution. Thanks for the information.

  28. Anonymous says:
    February 22, 2006 at 5:14 am

    The instructions seem nice and detailed but they just don’t work for me!

    I’m using Mac OSX panther, Firefox 1.5 and every time I try and start it with the changes I get an error saying: “Configuration Error. Failed to read the configuration file. Please contact your system administrator”

    Any thoughts?

  29. Anonymous says:
    March 2, 2006 at 10:34 pm

    With OS X 10.4.5 running firefox 1.5.0.1 I have been unable to avoid the configuration error arising in the prefcalls.js. However, some of the locks do take effect. This has been noted on the mozilla forums as a bug, but no one has addressed this, so until someone can post back here that this issue has been solved, I recommend that people NOT use this solution.

  30. Squeaner says:
    March 3, 2006 at 10:01 pm

    This post has been removed by a blog administrator.

  31. dlbayne says:
    March 21, 2006 at 1:45 am

    As a follow-up to my Feb 17, 2006 comment, I found a suggestion in the following forum:

    http://forums.mozillazine.org/viewtopic.php?p=2159534#2159534

    I had success putting the byteshifted file into /usr/local settings/firefox. First I tried “all users”, which only seemed to work for the administrator account. Then I tried putting a copy of the file in each limited user’s “local settings”. I still seemed to have problems with the limited accounts. Then for some reason I removed all copies from all users’ so that the file only existed in the Firefox program directory (as per Chris Ilias’ instructions). Now all users can access Firefox just fine and the lockprefs are doing their job. Go figure. The only other thing I did was to delete all files in /local settings/temp and /recent. (I don’t recommend anyone else try this; I just took a chance.) Perhaps Firefox was looking at a cache. Or maybe that had nothing to do with the positive result. I have no idea.

  32. Anonymous says:
    March 24, 2006 at 3:08 am

    Yeah, I can confirm that on Mac OS X 10.4.4 / Mozilla 1.5.0.1, this solution doesn’t work.

    I triple-checked everything and I still get the error message when the browser tries to open.

    Please fix.

    P.S. Macs rock!

  33. Anonymous says:
    March 28, 2006 at 1:04 pm

    i have this working with 10.4.x Recreated my clones with 10.4.5 added in the firefox tweaks, no prob. Just thought you would like to know it is possible

  34. Anonymous says:
    March 28, 2006 at 2:47 pm

    This post has been removed by a blog administrator.

  35. Anonymous says:
    April 10, 2006 at 2:48 pm

    We had some problems with 4.5.0.1 and locked settings. The error we received had something to do with a boolean error on line 91 in the prefcalls file. When we launched Firefox, the settings would lock correctly, but we would receive a long error message that started out with “Netscape.cfg/Autoconfig failed”

    It turned out that the “privacy.popups.policy” setting in our encoded file had changed from a boolean value to an integer across the Firefox versions. We changed it from true to 1 and the problem was fixed. Removing it also fixed the problem.

    Hope this helps.

    Bill

  36. yaodownload2006 says:
    April 19, 2006 at 1:37 am

    IziLock Easily lock your Windows folder with password !

  37. Michael Kaply says:
    May 19, 2006 at 4:30 pm

    I added locked preferences support to the CCK.

    Much easier

    http://www.mozilla.org/projects/cck/firefox

  38. qua says:
    August 12, 2006 at 1:54 pm

    cant seem to get the hang of this on my windows 2000 console what else do i need to do as i have done the procedure in a step by step fashion and still no break through
    would appreciate any form of assitance

  39. ron says:
    August 14, 2006 at 2:18 pm

    for ubuntu add the lockPref code to /usr/lib/firefox/firefox.cfg

  40. jon says:
    August 23, 2006 at 10:05 pm

    I can’t get this to work on my Win 2000/XP systems either. Followed the steps line by line… ๐Ÿ™ Does something change with the latest version of Firefox (1.5.0.6)?

  41. Lock Firefox Preferences - enrii.blog says:
    November 6, 2006 at 9:52 pm

    […] Reference: Locking Mozilla Firefox Settings […]

  42. silentk::cbx33 » Securing Firefox for schools usage says:
    March 14, 2007 at 7:23 am

    […] it. I hope. Thanks to this blog for giving a great tutorial on […]

  43. willrendell.co.uk » Blog Archive » Lock Firefox Settings says:
    December 12, 2007 at 5:59 pm

    […] http://ilias.ca/blog/2005/03/locking-mozilla-firefox-settings/ […]

  44. Firefox - Chris Ilias’ Blog ” Locking Mozilla Firefox Settings | Broad Help says:
    December 23, 2007 at 1:33 pm

    […] Chris Ilias’ Blog ” Locking Mozilla Firefox Settings I still dream of Organon … of Mozilla Firefox and you want to lock certain settings/options, so users cannot edit them. … Archive ” Lock Firefox Settings … […]

  45. hahaha.rootbox.or.id » Blog Archive » Mengunci konfigurasi firefox says:
    January 15, 2008 at 6:52 pm

    […] MozillaZine KnowledgeBase: Locking preferences MozillaZine KnowledgeBase: Configuration utilities for administrators Chris Ilias Blog: Locking mozilla firefox settings […]

  46. Block traffic forwaded to an another proxy - CPUG: The Check Point User Group says:
    April 11, 2008 at 11:44 am

    […] Group policy… we also figured out other browsers such as Firefox we used this site we fouind. Chris Ilias’ Blog ยป Locking Mozilla Firefox Settings Not sure if checkpoint web filtering is able to do what you want….but i would think so. […]

  47. change firefox homepage says:
    June 19, 2008 at 11:34 am

    […] them. For instance you may want to prevent people from changing the proxy setting, the homepage, thehttp://ilias.ca/blog/2005/03/locking-mozilla-firefox-settings/JS Online: Setting Your Browser&39s Home Page1. Go to Preferences in the firefox menu of your […]

Show Comments

Comments are closed.

Recent Posts

  • The screenshot option in Firefox has moved. Here’s how to find it.
  • Clippings for Thunderbird replacement: Quicktext
  • How to fix Firefox Sync issues by resetting your data
  • How to edit Firefox for iOS bookmarks
  • How to add the share menu to the Firefox address bar

Recent Comments

  • Norman on The screenshot option in Firefox has moved. Here’s how to find it.
  • Chris Ilias on How to add the share menu to the Firefox address bar
  • G on How to add the share menu to the Firefox address bar
  • Up North on The screenshot option in Firefox has moved. Here’s how to find it.
  • Richard on The screenshot option in Firefox has moved. Here’s how to find it.

Archives

March 2005
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  
    Apr »

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Search

Archives

Categories

  • ilias.ca (24)
  • Mozilla (171)
    • Firefox (93)
    • Mozilla Suite (16)
    • SeaMonkey (25)
    • Thunderbird (47)
  • Netscape (11)
  • Personal (48)
Copyright 2026 — Chris Ilias. All rights reserved. Blogsy WordPress Theme