Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Este site está com funcionalidades limitadas enquanto realizamos manutenção para melhorar sua experiência de uso. Se nenhum artigo resolver seu problema e você quiser fazer uma pergunta, nossa comunidade de suporte pode te ajudar em @FirefoxSupport no Twitter e /r/firefox no Reddit.

Pesquisar no site de suporte

Evite golpes de suporte. Nunca pedimos que você ligue ou envie uma mensagem de texto para um número de telefone, ou compartilhe informações pessoais. Denuncie atividades suspeitas usando a opção “Denunciar abuso”.

Saiba mais

Esta discussão foi arquivada. Faça uma nova pergunta se precisa de ajuda.

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

  • 4 respostas
  • 1 tem este problema
  • 10 visualizações
  • Última resposta de 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...

Alterado por jason.keen em

Todas as respostas (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

Alterado por cor-el em