X
Tap here to go to the mobile version of the site.
Your Firefox is out of date and may contain a security risk! Upgrade Firefox

Support Forum

What happened to mozilla.cfg?

Posted

The last SMS package I created for Firefox was 6.0.2 so my apology if this is old news. From what I understand user.js replaced mozilla.cfg? What about lockpref, is their an equivalence? I'm also a little puzzled as to how one is suppose to use "browser.startup.homepage_override.mstone" or "browser.shell.checkDefaultBrowser" within user.js when the location it's suppose to be in doesn't exist untill the application is executed. Am I missing something?

Chosen solution

See also:

Use a mozilla.cfg file in the Firefox program folder to lock prefs or specify default values.
Place a file local-settings.js in the defaults\pref folder where you also find the file channel-prefs.js to specify using mozilla.cfg.

pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0); // use this to disable the byte-shift

You can use these functions in mozilla.cfg:

defaultPref();  // set new default value
pref();         // set pref, but allow changes in current session
lockPref();     // lock pref, disallow changes
Read this answer in context 2

Additional System Details

Application

  • User Agent:

More Information

knorretje 161 solutions 582 answers

Helpful Reply

The last time I checked (for firefox 8) mozilla.cfg and lockpref were still working. Why do you think that they no longer work? user.js and mozilla.cfg are two different things, so user.js could never replace mozilla.cfg.

cor-el
  • Top 10 Contributor
  • Moderator
10753 solutions 96760 answers

Chosen Solution

See also:

Use a mozilla.cfg file in the Firefox program folder to lock prefs or specify default values.
Place a file local-settings.js in the defaults\pref folder where you also find the file channel-prefs.js to specify using mozilla.cfg.

pref("general.config.filename", "mozilla.cfg");
pref("general.config.obscure_value", 0); // use this to disable the byte-shift

You can use these functions in mozilla.cfg:

defaultPref();  // set new default value
pref();         // set pref, but allow changes in current session
lockPref();     // lock pref, disallow changes

Question owner

Works like a charm, thanks for the info.

david.tersigni 0 solutions 3 answers

We are having a similar problem after installing Firefox 13.0. After the installation it no longer recognizes one of the settings in the mozilla.cfg used to set configurations for the DoD STIGs. just get an error now when firefox starts. When I remove mozilla.cfg I dont get an error, but I still do not have settings locked down.

cor-el
  • Top 10 Contributor
  • Moderator
10753 solutions 96760 answers

Which line(s) in the mozilla.cfg file are causing that problem?

Does the file work if you remove that not working line?

david.tersigni 0 solutions 3 answers

the exception thrown does not point to any particular line in the mozilla.cfg file. I removed the line to load the pref("general.config.obscure_value", 0); which keeps the mozilla.cfg from loading all together, but I have not tried to comment each line in the mozilla.cfg yet. I will give that a try. the error is Netscape.cfg/AitpConfig failed. Please contact administrator. Error defaultPref failed[exception..."Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsPrefBranc.setCharPref]" nsresult "0x8000ffff NS_ERROR_UNEXPECTED)" locatipon"JSFrame::prefcalls.js::defaultPref::line 85" data: no]

cor-el
  • Top 10 Contributor
  • Moderator
10753 solutions 96760 answers

This error can be caused by trying to change/set a no longer supported (String) pref.

Do you see all prefs that you want to set on the about:config page?

david.tersigni 0 solutions 3 answers

Great suggestion, however all of the setting were supported. Of about 15 setting, I ended up finding one that caused the exception. This was very strange, since the setting did show up in about:config. I ended up diableing each and every line in the mozilla.cfg file until I found the error. The Problem ended up being an incidious syntax error! For some reason I had quotes around the value on just that one entry. on all version of Firefox up through version 12.0 all ignored the quotes, but when we installed 13.0 last week, it choked on the quotes. For the DoD STIG Vulnerabiltiy ID V0015770 I had : lockPref("network.protocol-handler.external.shell, "false"); It should have been lockPref("network.protocol-handler.external.shell, false);

Thanks for the suggestion.

v/r Dave Tersigni CISSP

cor-el
  • Top 10 Contributor
  • Moderator
10753 solutions 96760 answers

Make sure to have quotes around the pref name:

  • lockPref("network.protocol-handler.external.shell", false);