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

Why can't firefox read my mozilla.cfg file?

  • 4 replies
  • 1 has this problem
  • 10 views
  • Last reply by cor-el

more options

Hi, I have created a local-settings .js file and placed it into C:\Program Files (x86)\Mozilla Firefox\defaults\pref it contains the following.

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

Then I created a mozilla.cfg file and placed it into C:\Program Files (x86)\Mozilla Firefox it contains the following.

// Set default homepage - users can change defaultPref("browser.startup.homepage","data:text/plain,browser.startup.homepage=https://sharepoint.mydomain.org.uk | http://www.mywebsite.org.uk");

//Allow NTLM to proxies defaultPref("network.automatic-ntlm-auth.allow-proxies", true);

//Proxy settings defaultPref("network.proxy.http", smoothwall.mydomain.org.uk); defaultPref("network.proxy.http_port", 8080);

//No proxy for defaultPref("network.proxy.no_proxies_on", localhost, 127.0.0.1, 192.168.3.1, smoothwall.mydomain.org.uk, HAP.mydomain.org.uk, 192.168.3.85, *.mydomain.org.uk, sharepoint.mydomain.org.uk);

//Allow NTLM for defaultPref("network.automatic-ntlm-auth.trusted-uris", https://sharepoint.mydomain.org.uk, sharepoint.mydomain.org.uk);

Now when I open Firefox I am seeing the Failed to read configuration file. message.

I cant seem to work out what is wrong with my configuration file...

Hi, I have created a local-settings .js file and placed it into C:\Program Files (x86)\Mozilla Firefox\defaults\pref it contains the following. // use this to disable the byte-shift pref("general.config.filename", "mozilla.cfg"); pref("general.config.obscure_value", 0); Then I created a mozilla.cfg file and placed it into C:\Program Files (x86)\Mozilla Firefox it contains the following. // Set default homepage - users can change defaultPref("browser.startup.homepage","data:text/plain,browser.startup.homepage=https://sharepoint.mydomain.org.uk | http://www.mywebsite.org.uk"); //Allow NTLM to proxies defaultPref("network.automatic-ntlm-auth.allow-proxies", true); //Proxy settings defaultPref("network.proxy.http", smoothwall.mydomain.org.uk); defaultPref("network.proxy.http_port", 8080); //No proxy for defaultPref("network.proxy.no_proxies_on", localhost, 127.0.0.1, 192.168.3.1, smoothwall.mydomain.org.uk, HAP.mydomain.org.uk, 192.168.3.85, *.mydomain.org.uk, sharepoint.mydomain.org.uk); //Allow NTLM for defaultPref("network.automatic-ntlm-auth.trusted-uris", https://sharepoint.mydomain.org.uk, sharepoint.mydomain.org.uk); Now when I open Firefox I am seeing the Failed to read configuration file. message. I cant seem to work out what is wrong with my configuration file...

Modified by jason.keen

All Replies (4)

more options

You forgot some quotes in the defaultPref lines that have a String value.

// Set default homepage - users can change
defaultPref("browser.startup.homepage","data:text/plain,browser.startup.homepage=https://sharepoint.mydomain.org.uk | http://www.mywebsite.org.uk");

//Allow NTLM to proxies
defaultPref("network.automatic-ntlm-auth.allow-proxies", true);

//Proxy settings
defaultPref("network.proxy.http", "smoothwall.mydomain.org.uk");
defaultPref("network.proxy.http_port", 8080);

//No proxy for
defaultPref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, 192.168.3.1, smoothwall.mydomain.org.uk, HAP.mydomain.org.uk, 192.168.3.85, *.mydomain.org.uk, sharepoint.mydomain.org.uk");

//Allow NTLM for
defaultPref("network.automatic-ntlm-auth.trusted-uris", "https://sharepoint.mydomain.org.uk, sharepoint.mydomain.org.uk"); 
more options

Remember that the mozilla.cfg is run as a JavaScript file with full chrome privileges and any error in the file will throw an error and give you the error message that you got (failed ot read the configuration file).

Easiest to troubleshoot such issues is to comment out lines or use a try and catch block to be able to log error messages.

more options

Thanks, where? I'm not sure I get what you mean? And how do I comment out lines and catch block?

cor-el said

You forgot some quotes in the defaultPref lines that have a String value.
// Set default homepage - users can change
defaultPref("browser.startup.homepage","data:text/plain,browser.startup.homepage=https://sharepoint.mydomain.org.uk | http://www.mywebsite.org.uk");

//Allow NTLM to proxies
defaultPref("network.automatic-ntlm-auth.allow-proxies", true);

//Proxy settings
defaultPref("network.proxy.http", "smoothwall.mydomain.org.uk");
defaultPref("network.proxy.http_port", 8080);

//No proxy for
defaultPref("network.proxy.no_proxies_on", "localhost, 127.0.0.1, 192.168.3.1, smoothwall.mydomain.org.uk, HAP.mydomain.org.uk, 192.168.3.85, *.mydomain.org.uk, sharepoint.mydomain.org.uk");

//Allow NTLM for
defaultPref("network.automatic-ntlm-auth.trusted-uris", "https://sharepoint.mydomain.org.uk, sharepoint.mydomain.org.uk"); 
more options

Edit: I've edited the try/catch example with easier to use code.

I've added the quotes in my above reply. You can compare my reply to what you posted above or use my version instead to test if it works.

You wrote:

//Proxy settings
defaultPref("network.proxy.http", smoothwall.mydomain.org.uk);  

No quotes around: smoothwall.mydomain.org.uk With quotes added:

defaultPref("network.proxy.http", "smoothwall.mydomain.org.uk");

Remember that all string pref values need to be quoted.


Example of a try and catch: var test1 = "network.proxy.http"; try{defaultPref(test1, smoothwall.mydomain.org.uk); clearPref(test1+".log"); }catch(e){pref(test1+".log", e.toString())}

Response in the network.proxy.http.log pref:

network.proxy.http.log: ReferenceError: smoothwall is not defined

Modified by cor-el