Този сайт ще има ограничена функционалност, докато се извършва тече неговата поддръжка. Ако дадена статия не може реши проблема ви и искате да зададете въпрос, нашата общност е готова да ви помогне на @firefox в Twitter и /r/firefox в Reddit.

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

Unable to lock preferences on Windows with ESR-60 and above

  • 2 отговора
  • 1 има този проблем
  • 17 изгледи
  • Последен отговор от Dwight

more options

I have the issue noted in shekpal's post on https://support.mozilla.org/en-US/questions/1229450/edit/1167251. It seems to be limited to installation of ESR-60 (and above) on Windows platforms. With ESR-52.9 (and older) the files which I placed into "Program Files\Mozilla Firefox\defaults\prefs\local-settings.js" and "Program Files\Mozilla Firefox\mozilla.cfg" are able to make settings and lock preferences. The settings which I used in the files are similar to those listed by shekpal. When I use the same files, in the same locations with ESR-60 (and above) installed on Windows 7 or Windows 10: I open about:config and same the settings are either listed as "user set" or "default" and can be changed. That is not desired behavior. I have also placed the same files into installation of ESR-52.9 and ESR-60 (and above) on Linux installations (as "/usr/lib64/firefox/mozilla.cfg" and "/usr/lib64/firefox/defaults/preferences/local-settings.js") and the locked behavior is as desired--about:config shows the settings as locked. I followed the steps in https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig to completely reset and used the names of autoconfig.js and firefox.cfg. I ensured that the first line was a comment. Nothing restored the desired functionality on a Windows system. An additional anomaly which I did find is that if I have "Program Files\Mozilla Firefox\defaults\prefs\local-settings.js" in place without the referenced mozilla.cfg file in place gives these results: Firefox 52.9-ESR displays an error that preferences cannot be found and closes. That is expected behavior. Firefox 60.3-ESR opens without displaying an error.

I have the issue noted in shekpal's post on https://support.mozilla.org/en-US/questions/1229450/edit/1167251. It seems to be limited to installation of ESR-60 (and above) on Windows platforms. With ESR-52.9 (and older) the files which I placed into "Program Files\Mozilla Firefox\defaults\prefs\local-settings.js" and "Program Files\Mozilla Firefox\mozilla.cfg" are able to make settings and lock preferences. The settings which I used in the files are similar to those listed by shekpal. When I use the same files, in the same locations with ESR-60 (and above) installed on Windows 7 or Windows 10: I open about:config and same the settings are either listed as "user set" or "default" and can be changed. That is not desired behavior. I have also placed the same files into installation of ESR-52.9 and ESR-60 (and above) on Linux installations (as "/usr/lib64/firefox/mozilla.cfg" and "/usr/lib64/firefox/defaults/preferences/local-settings.js") and the locked behavior is as desired--about:config shows the settings as locked. I followed the steps in https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig to completely reset and used the names of autoconfig.js and firefox.cfg. I ensured that the first line was a comment. Nothing restored the desired functionality on a Windows system. An additional anomaly which I did find is that if I have "Program Files\Mozilla Firefox\defaults\prefs\local-settings.js" in place without the referenced mozilla.cfg file in place gives these results: Firefox 52.9-ESR displays an error that preferences cannot be found and closes. That is expected behavior. Firefox 60.3-ESR opens without displaying an error.

Избрано решение

I managed to correct the issue. The fix is to ensure that autoconfig.js (as described in https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig ) is Unix formatted on a Windows system. This may be counter-intuitive, but that was it. Either create the file in Notepad++ with settings to use Unix (LF) format for line ending or run "dos2unix" after file is created if using notepad. By merely running dos2unix on my file (which was named local-settings.js), the same settings which had worked since 2011 now work on Firefox 60.3.0-ESR. The configuration file ("mozilla.cfg") is still DOS formatted and works without running dos2unix.

As for "customizing-firefox-using-policies.json", that does not work because some of the settings desired are not in the listing of policies which can be defined. That is in addition to a security auditing requirement that opening about:config will show specific settings marked as lockPref.

Прочетете този отговор в контекста 👍 0

Всички отговори (2)

more options

Hi Dwight:

This is a Firefox for Enterprise question and so I moved the question from "Firefox" to "Firefox for Enterprise". This Forum is for "Firefox" NOT "Firefox for Enterprise". Confusing but true and this happened only a few releases ago so even more confusing :-)

I think that our documentation for Firefox for Enterprise should help, specifically

https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson

If not, I'll get our Firefox for Enterprise folks to help.

Cheers!

....Roland

more options

Избрано решение

I managed to correct the issue. The fix is to ensure that autoconfig.js (as described in https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig ) is Unix formatted on a Windows system. This may be counter-intuitive, but that was it. Either create the file in Notepad++ with settings to use Unix (LF) format for line ending or run "dos2unix" after file is created if using notepad. By merely running dos2unix on my file (which was named local-settings.js), the same settings which had worked since 2011 now work on Firefox 60.3.0-ESR. The configuration file ("mozilla.cfg") is still DOS formatted and works without running dos2unix.

As for "customizing-firefox-using-policies.json", that does not work because some of the settings desired are not in the listing of policies which can be defined. That is in addition to a security auditing requirement that opening about:config will show specific settings marked as lockPref.

Променено на от Dwight