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 To Make mozilla.cfg, override.ini, all-companyname.js, Files To Work Once And For All For All Users

more options

I'm currently trying to apply a fix to the firefox browser (version 23.0.1) on over 250 computers. Setting default webpages, disabling annoying prompts like the default browser and importing bookmarks, and erasing the history on shutdown, or startup. This is very easily done modifying the pref.js file, but I will not edit that file, it's out of the question. Another FF update will erase or overwrite all of my modifications.

I run a computer lab in the university that is locked down using a Net Support School console. You don't need to look that up. Basically all websites are restricted except the ones the ones I whitelist. The websites we use have extensive API's for JS, CSS, Java, PHP, etc... We utilize technology in order for students to use graphing calculators, video's, and taking module test from these white-listed websites, like Pearson, or Aleks. Now with that said, cookies, and stored profile history become a problem, and on some day's up to 25% of the students using the computers need their entire history deleted in order for a page to load. I think I fixed this problem permanently by whitelisting backend sites importing plugins, and API's etc, that I found from the developers console. Whatever. What I've learned from all of this is that Firefox can be very customizable utilizing the "...\Mozilla Firefox\mozilla.cfg" and the "...\Mozilla Firefox\defaults\prefs\all-companyname.js" (or custom.js) The problem, is no matter what I try I can't get these to work. The closest I got was here:

http://www.intrntpirate.com/?p=615

Again, even that ^^ didn't work. I followed these directions to a "T". What is wrong with the above information provided in the link? Why is firefox making harder and harder for us to optimize it for massive deployments across a corporation and a university? I'm not going to do any fancy hacks to avoid the main issue. I need mozilla.cfg, and the all-companyname.js, and the override.ini files to work, if and only if they are still relevant.

These are what my files look like so far:

name: all-lmc.js
location: C:\Program Files (x86)\Mozilla Firefox\defaults\pref\
pref("general.config.filename", "mozilla.cfg");
pref("browser.startup.homepage", "https://(some url)");

name: override.ini
location: C:\Program Files (x86)\Mozilla Firefox\
[XRE]
EnableProfileMigrator=false

name: mozilla.cfg
location: C:\Program Files (x86)\Mozilla Firefox\
//
lockPref("privacy.sanitize.sanitizeOnShutdown", true);
lockPref("privacy.sanitize.promptOnSanitize", false);
lockPref("browser.shell.checkDefaultBrowser", false);
lockPref("toolkit.telemetry.enabled", false);
lockPref("toolkit.telemetry.prompted", 2);
lockPref("toolkit.telemetry.rejected", true);

I've tried using, and not using, the automatic mozilla configurator. I've tried changing lockPref to pref. Nothing works. Not the override.ini, not the all-lmc.js, and not the mozilla.cfg. I've wasted hours reading through blogs of experts telling us to modify files that don't exist, or beating around the bush. I'm done researching. If you have the answer or want to help me figure this out just remember to keep it simple. Please. I ultimately want to package all the config files, with a how to, in a zip folder onto our shared drive. To have FF customized and ready to deploy to different departments across campus.

I'm currently trying to apply a fix to the firefox browser (version 23.0.1) on over 250 computers. Setting default webpages, disabling annoying prompts like the default browser and importing bookmarks, and erasing the history on shutdown, or startup. This is very easily done modifying the pref.js file, but I will not edit that file, it's out of the question. Another FF update will erase or overwrite all of my modifications. I run a computer lab in the university that is locked down using a Net Support School console. You don't need to look that up. Basically all websites are restricted except the ones the ones I whitelist. The websites we use have extensive API's for JS, CSS, Java, PHP, etc... We utilize technology in order for students to use graphing calculators, video's, and taking module test from these white-listed websites, like Pearson, or Aleks. Now with that said, cookies, and stored profile history become a problem, and on some day's up to 25% of the students using the computers need their entire history deleted in order for a page to load. I think I fixed this problem permanently by whitelisting backend sites importing plugins, and API's etc, that I found from the developers console. Whatever. What I've learned from all of this is that Firefox can be very customizable utilizing the "...\Mozilla Firefox\mozilla.cfg" and the "...\Mozilla Firefox\defaults\prefs\all-companyname.js" (or custom.js) The problem, is no matter what I try I can't get these to work. The closest I got was here: http://www.intrntpirate.com/?p=615 Again, even that ^^ didn't work. I followed these directions to a "T". What is wrong with the above information provided in the link? Why is firefox making harder and harder for us to optimize it for massive deployments across a corporation and a university? I'm not going to do any fancy hacks to avoid the main issue. I need mozilla.cfg, and the all-companyname.js, and the override.ini files to work, if and only if they are still relevant. These are what my files look like so far: name: all-lmc.js<br /> location: C:\Program Files (x86)\Mozilla Firefox\defaults\pref\<br /> pref("general.config.filename", "mozilla.cfg");<br /> pref("browser.startup.homepage", "https://(some url)");<br /> name: override.ini<br /> location: C:\Program Files (x86)\Mozilla Firefox\<br /> [XRE]<br /> EnableProfileMigrator=false<br /> <br /> name: mozilla.cfg<br /> location: C:\Program Files (x86)\Mozilla Firefox\<br /> //<br /> lockPref("privacy.sanitize.sanitizeOnShutdown", true);<br /> lockPref("privacy.sanitize.promptOnSanitize", false);<br /> lockPref("browser.shell.checkDefaultBrowser", false);<br /> lockPref("toolkit.telemetry.enabled", false);<br /> lockPref("toolkit.telemetry.prompted", 2);<br /> lockPref("toolkit.telemetry.rejected", true); I've tried using, and not using, the automatic mozilla configurator. I've tried changing lockPref to pref. Nothing works. Not the override.ini, not the all-lmc.js, and not the mozilla.cfg. I've wasted hours reading through blogs of experts telling us to modify files that don't exist, or beating around the bush. I'm done researching. If you have the answer or want to help me figure this out just remember to keep it simple. Please. I ultimately want to package all the config files, with a how to, in a zip folder onto our shared drive. To have FF customized and ready to deploy to different departments across campus.

Modified by cor-el

Chosen solution

The error console warnings are OK.

Is the general.config.obscure_value pref set to the default value 0?

You can try to save these versions of the files (open them in a Firefox tab and save them via Save Page As). Edit: Note that both files need to start with a comment line (//).


local-settings.js

data:text/plain;charset=utf-8;base64,Ly8gc3RhcnQgZmlsZSB3aXRoIGEgY29tbWVudCBsaW5lCnByZWYoImdlbmVyYWwuY29uZmlnLmZpbGVuYW1lIiwgIm1vemlsbGEuY2ZnIik7CnByZWYoImdlbmVyYWwuY29uZmlnLm9ic2N1cmVfdmFsdWUiLCAwKTsK

mozilla.cfg

data:text/plain;charset=utf-8;base64,Ly8KcHJlZigicHJpdmFjeS5zYW5pdGl6ZS5zYW5pdGl6ZU9uU2h1dGRvd24iLCB0cnVlKTsKcHJlZigicHJpdmFjeS5zYW5pdGl6ZS5wcm9tcHRPblNhbml0aXplIiwgZmFsc2UpOwpwcmVmKCJicm93c2VyLnJpZ2h0cy5vdmVycmlkZSIsIHRydWUpOwpwcmVmKCJhcHAudXBkYXRlLmF1dG8iLCBmYWxzZSk7CnByZWYoImV4dGVuc2lvbnMuYmxvY2tsaXN0LmVuYWJsZWQiLCBmYWxzZSk7CnByZWYoImV4dGVuc2lvbnMuc2hvd25TZWxlY3Rpb25VSSIsIHRydWUpOwpwcmVmKCJicm93c2VyLnNoZWxsLmNoZWNrRGVmYXVsdEJyb3dzZXIiLCBmYWxzZSk7CnByZWYoInRvb2xraXQudGVsZW1ldHJ5LmVuYWJsZWQiLCBmYWxzZSk7CnByZWYoInRvb2xraXQudGVsZW1ldHJ5LnByb21wdGVkIiwgMik7CnByZWYoInRvb2xraXQudGVsZW1ldHJ5LnJlamVjdGVkIiwgdHJ1ZSk7CnByZWYoImFwcC51cGRhdGUuYXV0byIsIGZhbHNlKTsKcHJlZigiYnJvd3Nlci5kb3dubG9hZC51c2VEb3dubG9hZERpciIsIHRydWUpOwpwcmVmKCJicm93c2VyLnNlYXJjaC51cGRhdGUiLCBmYWxzZSk7CnByZWYoInNpZ25vbi5hdXRvZmlsbEZvcm1zIiwgZmFsc2UpOwpwcmVmKCJzaWdub24ucmVtZW1iZXJTaWdub25zIiwgZmFsc2UpOwpwcmVmKCJicm93c2VyLmRvd25sb2FkLm1hbmFnZXIuc2NhbldoZW5Eb25lIiwgdHJ1ZSk7CnByZWYoImJyb3dzZXIuZm9ybWZpbGwuZW5hYmxlIiwgZmFsc2UpOwpwcmVmKCJ4cGluc3RhbGwuZW5hYmxlZCIsIHRydWUpOwo=
Read this answer in context 👍 3

All Replies (20)

more options

sorry for the bad formatting showing what my files look like. It didn't look like that in the review. Here's another go.

name: all-lmc.js
location: C:\Program Files (x86)\Mozilla Firefox\defaults\pref\
pref("general.config.filename", "mozilla.cfg");
pref("browser.startup.homepage", "https://(some url)");

name: override.ini 
location: C:\Program Files (x86)\Mozilla Firefox\
[XRE] 
EnableProfileMigrator=false

name: mozilla.cfg
location: C:\Program Files (x86)\Mozilla Firefox\
lockPref("privacy.sanitize.sanitizeOnShutdown", true);
lockPref("privacy.sanitize.promptOnSanitize", false);
lockPref("browser.shell.checkDefaultBrowser", false);
lockPref("toolkit.telemetry.enabled", false);
lockPref("toolkit.telemetry.prompted", 2);
lockPref("toolkit.telemetry.rejected", true);

Sorry for the confusion

Modified by cor-el

more options

Did you make sure that the files do not have a hidden .txt file extension that may get added if you save a file as text file?


defaultPref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=http://www.bbc.co.uk");

Modified by cor-el

more options

hello Kerberos, please make sure that this line is included in your all-lmc.js file:

pref("general.config.obscure_value", 0);

another good resource on how to implement the lock on preferences is http://kb.mozillazine.org/Locking_preferences

more options

general.config.obscure_value is currently defaulted to 0, so this line is probably no longer needed.

  • Bug 305824 - Remove the obscuring of the autoconfig file.
more options

Thanks very much for your help, but I'm still overlooking something. I double checked to make sure that I did not have a hidden .txt file extention. I then decided to abandon the lock on preferences idea until I get it working. I converted my mozilla.cfg file back to plain text. I made sure I do not have an extra blank line at the end of each file. The syntax looks good, as far as I can tell. I'll copy and paste what I have so far. Did I have the file locations correct posted above? Also, if you feel i can delete some lines of text in my mozilla.cfg file I'll be happy to do so.

mozilla.cfg

//
pref("privacy.sanitize.sanitizeOnShutdown", true);
pref("privacy.sanitize.promptOnSanitize", false);
pref("browser.rights.override", true);
pref(“app.update.auto”, false);
pref(“extensions.blocklist.enabled”, false);
pref(“extensions.shownselectionUI”, true);
pref(“browser.shell.checkDefaultBrowser”, false);
pref(“toolkit.telemetry.enabled”, false);
pref(“toolkit.telemetry.prompted”, 2);
pref(“toolkit.telemetry.rejected”, true);
pref(“app.update.auto”, false);
pref(“browser.download.useDownloadDir”, true);
pref(“browser.search.update”, false);
pref(“signon.autofillForms”, false);
pref(“signon.rememberSignons”, false);
pref(“browser.download.manager.scanWhenDone”, true);
pref(“browser.formfill.enable”, false);
pref(“xpinstall.enabled”, true);

channel-prefs.js pref("app.update.channel", "release");

override.ini [XRE] EnableProfileMigrator=false

all-lmc.js pref("general.config.filename", "mozilla.cfg"); defaultPref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=http://bbc.co.uk");


Again, thank you very much for your time. Do I create my own browserconfig.properties, and firefox.js? Also, I forgot to mention I'm running Windows 8.

Modified by cor-el

more options

This last file isn't OK.
It contains Unicode quotes (“app.update.auto”) instead of regular quotes ("app.update.auto") like you used in first post.
Such Unicode quotes do not work.

Note that the article that you posted above (*) did also contain such Unicode quotes.
I didn't mention it because that first post showed the regular quotes.

pref(“app.update.auto”, false); -> pref("app.update.auto", false);

These functions can be used in the mozilla.cfg file:

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

It might be better not to include other pref lines in the file that defines the mozilla.cfg file, but make all settings in the mozilla.cfg file.

Modified by cor-el

more options

Thanks for pointing that out. I can clearly see it using a vim text editor. It must have changed when I decrypted it using the automatic mozilla configurator.

Question: I'm currently looking over the link you provided showing the different pref's I can use. Do I use this to output the errors in a text file? I believe my syntax is now correct fixing the "quotes" but I think the mozilla.cfg file isn't getting called. Something is overriding it. I just don't know what that is. By the way, I changed my pref(prefName, value) --> defaultPref(prefName, value) in the mozilla.cfg

Modified by Kerberos

more options

I don't want to keep anyone out of the loop on what's going on. So I'll attach 4 screen shots of what I have so far. If the syntax in the scripts and file locations are correct this should work according to the blogs I (and others) found online. Since it doesn't work at the moment, is it the type of FF we have installed? ESR vs. Standard, how can you tell? How do you debug? What would you do?

      • NOTE: On the very top of each image is the directory.
more options

The file that defines to use the mozilla.cfg file has to be in the same folder as the channel-prefs.js file. Files in this folder are never affected by an update, so only a clean install would cause this file to get lost.

That pref line really needs to be a pref() call and only mention the mozilla.cfg file and not the path.

Place a local-settings.js file 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");

See also:

more options

Thank you again for your help. I attached 5 screen shots of everything I have and I corrected everything you told me, I had a typo in the previous mozilla.cfg screen shot that I corrected. Question: Are the "local-settings.js" and and the "all-lmc.js" the same?

more options

Yes, the name of the file shouldn't matter. Only the location matters and that the file is a plain text file.
Note that mozilla.cfg needs to have Unix line endings (LF instead of CR/LF), so check that.

more options

See also:

override.ini now goes in INSTALLDIR\browser (so not in the main Fx program folder, but in the browser folder)

more options

Ok, so using Notepad++ I clicked on edit>EOL Conversion>Unix Format, for all of my files. Also, I moved override.ini into the browser folder.

For the link you provided, I don't have a distribution nor defaults folder. Only extensions and searchplugins. I provided another screenshot for how that now looks like.

Question: Do I move the defaults folder into the browser folder?

more options

Does the mozilla.cfg file work for you with my latest directions?

Any errors in the Browser/Error Console (Firefox/Tools > Web Developer;Ctrl+Shift+J)?

I've never had much problems with using this file in Firefox versions (I use it to set a home page and a few other prefs for all profiles).

more options

Unfortunatley mozilla.cfg does not work (even with unix format), I even put it in the browser folder, but I put it back. I attached two screenshots of my browser console showing warnings and information. I hope this helps

more options

Chosen Solution

The error console warnings are OK.

Is the general.config.obscure_value pref set to the default value 0?

You can try to save these versions of the files (open them in a Firefox tab and save them via Save Page As). Edit: Note that both files need to start with a comment line (//).


local-settings.js

data:text/plain;charset=utf-8;base64,Ly8gc3RhcnQgZmlsZSB3aXRoIGEgY29tbWVudCBsaW5lCnByZWYoImdlbmVyYWwuY29uZmlnLmZpbGVuYW1lIiwgIm1vemlsbGEuY2ZnIik7CnByZWYoImdlbmVyYWwuY29uZmlnLm9ic2N1cmVfdmFsdWUiLCAwKTsK

mozilla.cfg

data:text/plain;charset=utf-8;base64,Ly8KcHJlZigicHJpdmFjeS5zYW5pdGl6ZS5zYW5pdGl6ZU9uU2h1dGRvd24iLCB0cnVlKTsKcHJlZigicHJpdmFjeS5zYW5pdGl6ZS5wcm9tcHRPblNhbml0aXplIiwgZmFsc2UpOwpwcmVmKCJicm93c2VyLnJpZ2h0cy5vdmVycmlkZSIsIHRydWUpOwpwcmVmKCJhcHAudXBkYXRlLmF1dG8iLCBmYWxzZSk7CnByZWYoImV4dGVuc2lvbnMuYmxvY2tsaXN0LmVuYWJsZWQiLCBmYWxzZSk7CnByZWYoImV4dGVuc2lvbnMuc2hvd25TZWxlY3Rpb25VSSIsIHRydWUpOwpwcmVmKCJicm93c2VyLnNoZWxsLmNoZWNrRGVmYXVsdEJyb3dzZXIiLCBmYWxzZSk7CnByZWYoInRvb2xraXQudGVsZW1ldHJ5LmVuYWJsZWQiLCBmYWxzZSk7CnByZWYoInRvb2xraXQudGVsZW1ldHJ5LnByb21wdGVkIiwgMik7CnByZWYoInRvb2xraXQudGVsZW1ldHJ5LnJlamVjdGVkIiwgdHJ1ZSk7CnByZWYoImFwcC51cGRhdGUuYXV0byIsIGZhbHNlKTsKcHJlZigiYnJvd3Nlci5kb3dubG9hZC51c2VEb3dubG9hZERpciIsIHRydWUpOwpwcmVmKCJicm93c2VyLnNlYXJjaC51cGRhdGUiLCBmYWxzZSk7CnByZWYoInNpZ25vbi5hdXRvZmlsbEZvcm1zIiwgZmFsc2UpOwpwcmVmKCJzaWdub24ucmVtZW1iZXJTaWdub25zIiwgZmFsc2UpOwpwcmVmKCJicm93c2VyLmRvd25sb2FkLm1hbmFnZXIuc2NhbldoZW5Eb25lIiwgdHJ1ZSk7CnByZWYoImJyb3dzZXIuZm9ybWZpbGwuZW5hYmxlIiwgZmFsc2UpOwpwcmVmKCJ4cGluc3RhbGwuZW5hYmxlZCIsIHRydWUpOwo=

Modified by cor-el

more options

Thanks, That worked!!!! Just in case anyone has a similar issue, I will attach 4 screen shots that contain the file locations and the source code. Yours may vary.

I think what made the main difference was including a local-settings.js file in the same folder as my all-{insert company name here}.js file, even though I think that file is now useless. lol! And also putting the override.ini file into the INSTALLPATH\browser directory.

I don't know exactly what happened to my mozilla.cfg file and why it wasn't running the first time. Copying and Pasting what you gave me above done the trick. THANK YOU!!! I was comparing the differences and I didn't see anything that popped out at me.

Another big difference was using the

pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=http://bbc.co.uk");

which is obsolete and changed to

pref("browser.startup.homepage", "http://bbc.co.uk");

much simpler.

Modified by Kerberos

more options

I think that you only need the data URI version to set the default home page via defaultPref() (it is a complex string value that can be localized).

more options

I have all my files set up the same way as you, and the locations of each file is correct as well. How ever when ever i start up firefox, It is as if it completely ignores the .js files, and it never gets pointed at the .cfg file.

more options

Did you check the file type of the local-settings.js file to make sure that you didn't create a text file (local-settings.js.txt)?

Note that Windows hides some file extensions by default. Among them are .html and .ini and .js and .txt, so you may only see the name without file extension. You can see the real file type (file extension) in the Properties of the file via the right-click context menu in Windows Explorer.

  1. 1
  2. 2