為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Adding default settings throuh mozilla.cfg not working on firefox-26

  • 1 回覆
  • 15 有這個問題
  • 27 次檢視
  • 最近回覆由 cor-el

more options

I would like to set proxy settings to all the firefox process for non-root users, Earlier i used to do this by adding below lines in /usr/lib64/firefox/defaults/preferences/channel-perf.js

pref("general.config.obscure_value", 0); pref("general.config.filename", "mozilla.cfg");

and creating mozilla.cfg file in /usr/lib64/firefox directory as followd

lockPref("network.proxy.type", 1); lockPref("network.proxy.http", "127.0.0.1") lockPref("network.proxy.http_port", 3128) lockPref("network.proxy.share_proxy_settings", true)


How do i achieve the same in Firefox-26

I tried the following

In the /usr/lib64/firefox/browser/defaults/preferences directory, i created file channel-pref.js as follows pref("general.config.obscure_value", 0) pref("general.config.filename", "mozilla.cfg");


create mozilla.cfg file in /usr/lib64/firefox directory , then using moz-byteshift.pl i modified the mozilla.cfg moz-byteshift.pl -s 13 <mozilla.cfg.txt >mozilla.cfg

but it still doesn't work ,

Any information on how to make this work

I would like to set proxy settings to all the firefox process for non-root users, Earlier i used to do this by adding below lines in /usr/lib64/firefox/defaults/preferences/channel-perf.js pref("general.config.obscure_value", 0); pref("general.config.filename", "mozilla.cfg"); and creating mozilla.cfg file in /usr/lib64/firefox directory as followd lockPref("network.proxy.type", 1); lockPref("network.proxy.http", "127.0.0.1") lockPref("network.proxy.http_port", 3128) lockPref("network.proxy.share_proxy_settings", true) How do i achieve the same in Firefox-26 I tried the following In the /usr/lib64/firefox/browser/defaults/preferences directory, i created file channel-pref.js as follows pref("general.config.obscure_value", 0) pref("general.config.filename", "mozilla.cfg"); create mozilla.cfg file in /usr/lib64/firefox directory , then using moz-byteshift.pl i modified the mozilla.cfg moz-byteshift.pl -s 13 <mozilla.cfg.txt >mozilla.cfg but it still doesn't work , Any information on how to make this work

所有回覆 (1)

more options

It is best to leave the channel-prefs.js file alone and create a specific local-settings.js file to specify using mozilla.cfg in the defaults\pref folder where you also find the channel-prefs.js file.

pref("general.config.filename", "mozilla.cfg");

See:

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

Note that only the first pref line you posted is ending with a semi colon.
Also make sure that the first line of mozilla.cfg is a comment line as this line is always skipped.

//
lockPref("network.proxy.type", 1);
lockPref("network.proxy.http", "127.0.0.1");
lockPref("network.proxy.http_port", 3128);
lockPref("network.proxy.share_proxy_settings", true);