Trang web này sẽ có chức năng hạn chế trong khi chúng tôi trải qua bảo trì để cải thiện trải nghiệm của bạn. Nếu một bài viết không giải quyết được vấn đề của bạn và bạn muốn đặt câu hỏi, chúng tôi có cộng đồng hỗ trợ của chúng tôi đang chờ để giúp bạn tại @FirefoxSupport trên Twitter và /r/firefox trên Reddit.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

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

  • 4 trả lời
  • 1 gặp vấn đề này
  • 10 lượt xem
  • Trả lời mới nhất được viết bởi 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...

Được chỉnh sửa bởi jason.keen vào

Tất cả các câu trả lời (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

Được chỉnh sửa bởi cor-el vào