Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How do I lockdown Mozilla Firefox 5.0 user preferences ?

  • 23 majibu
  • 30 wana tatizo hili
  • 1 view
  • Last reply by Wolf5542

more options

I need to know how to lock down the user preferences in Mozilla 5.0 for example lockdown the proxy settings so that they cannot be changed by any user. I have been able to do so for FireFox 3 and FireFox 4. Is this possible in Firefox 5 ??

I need to know how to lock down the user preferences in Mozilla 5.0 for example lockdown the proxy settings so that they cannot be changed by any user. I have been able to do so for FireFox 3 and FireFox 4. Is this possible in Firefox 5 ??

All Replies (20)

more options

It is still done the same way with a mozilla.cfg file.

See:

more options

Yes I am very familiar with how to lock down Firefox 3 and 4. However locking down Firefox 4 was a bit different from locking down Firefox 3. Is Firefox 5 like either one of these in regards to where to place the .cfg file??? For example to lockdown Firfox 4 that .cgf file needed to be placed in the omni.jar file to work properly.

more options

You can place mozilla.cfg in the Firefox program folder, just like in Firefox 3.

The preferred way is not to edit omni.jar (greprefs.js or all.js).
Create a file local-settings.js with this content:

pref("general.config.obscure_value", 0); //  needed if you do not want to use byte shifting
pref("general.config.filename", "mozilla.cfg");

Copy the file local-settings.js to: C:\Program Files\Mozilla Firefox\defaults\pref

more options

Thanks a lot Ill check it out.

more options

Did this work for you? I am having the same problem, and have not been able to get Firefox to apply the locked settings in mozilla.cfg. (I was able to do this successfully with Firefox 3.x) I am working on a Mac, so the paths are slightly different, but I had no problem doing this with Firefox 3.x. Below are my modifications...

Contents of Firefox.app/Contents/MacOS/defaults/pref/local-settings.js

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


Contents of Firefox.app/Contents/MacOS/mozilla.cfg (just a sample setting for now)

lockPref("app.update.auto", false);

Modified by tdearborn

more options

I have not tried these settings in 5.x yet. I will at some point today (hopefully). Are you trying these settings with 5.x or 4.x ??

more options

Firefox 5.x

more options

I have just tried those for 5.x and those setting do not work. 4 was different from 3. It only makes sense 5 is going to differnt from 4. Oh well hopefully someone figures it out.

more options

Ok girls. I figured it out. the same settings for 4 have worked for 5.

This video will walk you through it step by step

http://www.youtube.com/watch?v=qaaRHxLCWYw

more options

I tried the procedure described in the video, but when I try to start Firefox 5 with the recompiled omni.jar in place the browser crashes. The details are as follows: AdapterDeviceID: 0046 AdapterVendorID: 8086 AvailableVirtualMemory: 2017488896 BuildID: 20110707182747 CrashTime: 1311198817 Email: [email protected] InstallTime: 1311088312 Notes: AdapterVendorID: 8086, AdapterDeviceID: 0046, AdapterDriverVersion: 8.15.10.2189

ProductName: Firefox SecondsSinceLastCrash: 15276 StartupTime: 1311198815 SystemMemoryUsePercentage: 65 Throttleable: 1 TotalVirtualMemory: 2147352576 URL: Vendor: Mozilla Version: 5.0.1

The only file in omni.jar that I edited was firefox.js. Edit in firefox.js consisted of adding this line at the end: pref("general.config.filename", "mozilla.cfg");

My mozilla.cfg was a text file byte-shifted 13 bytes using ByteShifter.

I get the same results even if I do nothing to the enclosed files, so the problem appears to be in the way WinZip re-creates the archive. Any suggestions?

Modified by cl0729

more options

You do not have to make changes to the omni.jar archive to make this work and you may corrupt that archive by doing that.

If you create a file local-settings.js (or a similar .js file with your preferred name) with the mozilla.cfg pref and place that file in the defaults\pref folder where you also find channel-prefs.js then it should work the same way as in Firefox 3 and 4 versions.

  • C:\Program Files\Mozilla Firefox\defaults\pref\local-settings.js

Make sure that the file mozilla.txt starts with // and that you apply the byte shift to get mozilla.cfg if you haven't disabled that in local-settings.js

See also:

  • Bug 595522 - Omnijar breaks prefs initialized via mozilla.cfg
more options

At this point I have tried two techniques recommended on this forum to lock down Firefox 5 and neither has worked. As co-el correctly notes, modifying the omni.jar file (as shown in tomperson349's video) appears to corrupt the file. I tried creating a local-settings.js file specifying my mozilla.cfg file as described by both cor-el and tomperson349 but that also does not work. I read through and tried the approach using the custom.js file as described in https://bugzilla.mozilla.org/show_bug.cgi?id=595522 but that doesn't work either. None of the prefs in my mozilla.cfg file are being read.

We have been using all.js to specify the location of our mozilla.cfg file on FF 3.6 with no difficulty and have also been using userchrome.css changes to alter the GUI. How can we accomplish the same thing with FF 5?

more options

Did you try a file mozilla.cfg without the byte shift and the pref to set the shift to 0?

Are other prefs in local-settings.js read?

You can only set a default value by using pref("pref_name", value);
So the pref shows as default on the about:config page.

Is mozilla.cfg a CFG file if you check that in the Properties of that file via the right-click context menu?

If the file cannot be processed then you should see an error message popping up to contact the Administrator and Firefox won't start.

more options

I experience similar problems using a local-prefs.js

I do not point on a mozilla.cfg but enter all prefs in the local-prefs.js

When a user starts Firefox for the first time, everything works as it should. However, when the user closes Firefox and starts it again, all settings appear to be overwritten by the user.js in the profile-folder.

Trying to use a cfg-file brings an error that the config file cannot be read. Very strange behavior.

Used version: 5.0.1

Modified by mtk1

more options

What is the content of the file mozilla.cfg without obfuscation?

The file needs to start with a comment line (<strike>\\</strike>//)

Did you try to disable the rot-13 obfuscation to see if that works?

Modified by cor-el

more options
  • local-prefs.js
pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");

Obfuscation should be diabled then and as far as I understand the mozilla.cfg can be in plain text.


  • mozilla.cfg
pref("browser.startup.homepage","http://www.somewebpage.com");
pref("browser.shell.checkDefaultBrowser", false);
pref("app.update.enabled", false);
pref("browser.download.useDownloadDir", false);

When I add \\ at the first line, the problem remains the same. By the way: Should comments be //? However, didn't work either...

What really bothers me: Even when I enter the content of the mozilla.cfg in the local-prefs.js it works. But only for the first time a user starts Firefox and gets his profile generated.

Modified by cor-el

more options

Sorry for the wrong comment slashes, it should of course be //.

You do need that first comment line to make mozilla.cfg.
If you use pref(); then you set the value of a pref.
If you want to lock a pref to a specific value then use lockPref();

//
lockPref("browser.startup.homepage", "http://www.somewebpage.com");
lockPref("browser.shell.checkDefaultBrowser", false);
lockPref("app.update.enabled", false);
lockPref("browser.download.useDownloadDir", false);
more options

No problem.

When I add the // it still get the error message that config-file cannto be read and that I should contact my sysadmin. The problem has to be something else.

I also tried to use the lockPref directly in a local-prefs.js, but it gets ignored entirely.

Is there any log or verbose debug output from firefox that would support the debugging or gives a more clear error output?

I also wonder weather it could be a matter of the OS. I try to get it done on a Win XP.

Modified by mtk1

more options

You can only use pref in local-prefs.js

Did you make sure that mozilla.cfg doesn't have a possibly hidden .txt file extension (mozilla.cfg.txt) ?

more options

Yes, I am sure.

  1. 1
  2. 2