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

搜尋 Mozilla 技術支援網站

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

了解更多

Issue implementing a lock file in 56.0.2 64 bit

  • 7 回覆
  • 1 有這個問題
  • 9 次檢視
  • 最近回覆由 reteer

more options

I am trying to lock down some preferences in about:config in Mozilla 56.0.2 64 bit. I created a Mozilla.cfg file, saved it as ANSI coded and placed it in the Mozilla installation directory. I then created a local-settings.js file and placed it in the defaults/pref subfolder. The .cfg file is as follows: // lockPref("security.default_personal_cert", 0);

The local-settings.js file is as follows:

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

After saving the files I close Mozilla and reopen to the following pop-up error:

AutoConfig Alert

Netscape.cfg/AutoConfig failed. Please contact sys admin: [Exception... "Component returned failure code:0x8000ffff (NS_ERROR_UNEXPECTED) [ns1PrefBranch.SetIntPref}" ns result: "0x8000ffff (NS_ERROR_UNEXPECTED) " location : "JS frame ::prefcall.js :: defaultPref :: line 58" data: no]

Firefox will still open despite the error and the applicable preference has been locked in about:config. How do I get rid of this error?

I am trying to lock down some preferences in about:config in Mozilla 56.0.2 64 bit. I created a Mozilla.cfg file, saved it as ANSI coded and placed it in the Mozilla installation directory. I then created a local-settings.js file and placed it in the defaults/pref subfolder. The .cfg file is as follows: // lockPref("security.default_personal_cert", 0); The local-settings.js file is as follows: pref("general.config.obscure_value", 0); pref("general.config,filename", "mozilla.cfg"); After saving the files I close Mozilla and reopen to the following pop-up error: AutoConfig Alert Netscape.cfg/AutoConfig failed. Please contact sys admin: [Exception... "Component returned failure code:0x8000ffff (NS_ERROR_UNEXPECTED) [ns1PrefBranch.SetIntPref}" ns result: "0x8000ffff (NS_ERROR_UNEXPECTED) " location : "JS frame ::prefcall.js :: defaultPref :: line 58" data: no] Firefox will still open despite the error and the applicable preference has been locked in about:config. How do I get rid of this error?

被選擇的解決方法

Maybe you could re-copy/paste that to be sure, since it seems to have typos in it. Also, I don't know where your file is setting an integer preference if you changed it to a string?

https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrefBranch#setIntPref()

從原來的回覆中察看解決方案 👍 0

所有回覆 (7)

more options

So, the interesting aspect of this is this going to work in Firefox 57 Final released tomorrow on the Mozilla servers as full version and updates or can get now https://fileforum.betanews.com/detail/Mozilla-Firefox-for-Windows/1032985422/1 So is this going to be a waste of time trying to get it to work with 56.0.2

Please let us know if this solved your issue or if need further assistance.

more options

reteer said

The .cfg file is as follows:
//
lockPref("security.default_personal_cert", 0);

When I look up security.default_personal_cert it is a string preference with two possible values:

  • "Ask Every Time" (default)
  • "Select Automatically"

What is the zero supposed to do?

To watch what happens in about:config (or prefs.js) you can toggle the preference on the Options/Preferences page:

  • Windows: "3-bar" menu button (or Tools menu) > Options
  • Mac: "3-bar" menu button (or Firefox menu) > Preferences
  • Linux: "3-bar" menu button (or Edit menu) > Preferences
  • Any system: type or paste about:preferences into the address bar and press Enter/Return to load it

Firefox 56-58: In the search box at the top of the page on the right side, type cert and Firefox should filter to the Certificates part of the page where you see two radio buttons for this setting.

Firefox 38-55: In the left column, click Advanced. Then on the right side, make the "Certificates" mini-tab active. I assume after that it's similar to Firefox 56+.

more options

The issue is not the setting for the preference, that has been set to "Ask Every Time" and is good. The problem is when I lock this particular preference down with the .cfg file and the local-settings.js files, it gives me the error when I reopen Firefox. I need to know how if there is a way to get rid of the error.

more options

What error do you get now?

more options

I get the same error as I posted originally.

AutoConfig Alert

Netscape.cfg/AutoConfig failed. Please contact sys admin: [Exception... "Component returned failure code:0x8000ffff (NS_ERROR_UNEXPECTED) [ns1PrefBranch.SetIntPref}" ns result: "0x8000ffff (NS_ERROR_UNEXPECTED) " location : "JS frame ::prefcall.js :: defaultPref :: line 58" data: no]

Despite the error this does lock down the configuration, but I need to get rid of this error.

more options

選擇的解決方法

Maybe you could re-copy/paste that to be sure, since it seems to have typos in it. Also, I don't know where your file is setting an integer preference if you changed it to a string?

https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrefBranch#setIntPref()

more options

the integer preference is the problem. I replaced the zero with one of the preference options which like you said is supposed to be a string, and no error! sorry just inexperience here. thanks for the info!