为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

policies.json not applying

  • 10 个回答
  • 1 人有此问题
  • 10 次查看
  • 最后回复者为 cor-el

more options

Hi,

I am running Firefox 74.0 on Windows 10 (1709). I have created a policies.json file and saved this in `C:\Program Files\Mozilla Firefox\distribution`.

The settings within it are not being applied. I tried to put this same policies.json file in a new folder named `distribution` under Firefox's binary location in a Linux environment and the policies didn't apply there either.

File as below:

{

 "policies": {
   "Certificates": {
     "ImportEnterpriseRoots": true,
     "Install": [
       "cert.pem"
     ]
   },
   "Homepage": {
     "StartPage": "homepage",
     "URL": "http://<our homepage redacted>"
   },
   "Proxy": {
     "AutoLogin": false,
     "HTTPProxy": "http://<proxy server redacted>:<port redacted>",
     "Mode": "system",
     "SOCKSVersion": 4,
     "UseHTTPProxyForAllProtocols": true,
     "UseProxyForDNS": false
   }
 }

}

Any advice would be much appreciated.

Kind regards, Edan

Hi, I am running Firefox 74.0 on Windows 10 (1709). I have created a policies.json file and saved this in `C:\Program Files\Mozilla Firefox\distribution`. The settings within it are not being applied. I tried to put this same policies.json file in a new folder named `distribution` under Firefox's binary location in a Linux environment and the policies didn't apply there either. File as below: { "policies": { "Certificates": { "ImportEnterpriseRoots": true, "Install": [ "cert.pem" ] }, "Homepage": { "StartPage": "homepage", "URL": "http://<our homepage redacted>" }, "Proxy": { "AutoLogin": false, "HTTPProxy": "http://<proxy server redacted>:<port redacted>", "Mode": "system", "SOCKSVersion": 4, "UseHTTPProxyForAllProtocols": true, "UseProxyForDNS": false } } } Any advice would be much appreciated. Kind regards, Edan

所有回复 (10)

more options

What if you try the simplest part only --

{
  "policies": {
    "Homepage": {
      "StartPage": "homepage",
      "URL": "https://support.mozilla.org/"
    }
  }
}

-- then add other policies one at a time?

more options

Hi,

Thanks for your rpely.

I have tried the below config as I thought it was the simplest and easiest policy to test. This did not work either. :(

{

 "policies": {
   "BlockAboutConfig": true
 }

}

Regards

more options

Are you sure there isn't a hidden .txt file extension on policies.json? See:

https://www.bleepingcomputer.com/tutorials/how-to-show-file-extensions-in-windows/

Usually exiting and restarting Firefox will trigger a re-read of policies.json but you also could try a system restart in case Firefox is not unloading properly.

more options

Are you possibly using GPO ? I don't think that policies.json works when GPO is active.

Did you check the about:policies page ?

more options

Hi,

We are not managing Firefox via GPO. The file extension is definitely .json (see attached image).

Weird, huh?

Thanks, Edan

more options

Any chance Firefox is running from a different directory, i.e., not

C:\Program Files\Mozilla Firefox\firefox.exe

more options

Hi,

No, it's definitely from that location. Also, can't get it to work on my Linux Mint VM either.

Thank you, Edan

more options

Does Firefox validate the policies.json file and view the file with the JSON viewer if you open the file is a tab ?

Did you try to recreate policies.json in Linux using an installed plain text editor then this should work and you should see the policy on the about:policies#active page.

If you use the same file in Linux and in Windows and the file isn't working in either then this would suggest a problem with the file.

more options

Hi,

The JSON looks fine to me.

Thanks Edan

more options

Your System Details list shows the Enterprise Policy Generator extension.

This extension would create GPO rules and that makes policies.json not work. The error you see on the about:policies#errors page also indicate that other rules are being applied that fail for some reason.

You can inspect the Mozilla and Firefox keys with the Windows Registry Editor in HKEY_LOCAL_MACHINE and possibly in HKEY_CURRENT_USER with the Windows Registry Editor to see whether GPO policy rules are active.

  • HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Mozilla\Firefox\
  • HKEY_CURRENT_USER\SOFTWARE\Policies\Mozilla\Firefox\