搜索 | 用户支持

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

详细了解

policies.json WebsiteFilter does not block website properly

more options

Suppose I have a "policies.json" file in the "distribution" subdirectory of my Firefox installation.

And suppose "policies.json" file contains this:

{

 "policies": {
     "WebsiteFilter": {
         "Block": [
           "youtube.com",
           "www.youtube.com",
           "http://www.youtube.com",
           "https://www.youtube.com",
         ]
     }
 }

}


Now if I type "youtube.com" in the address bar, it shows "Your organisation has blocked access to this page or web site." It means firefox blocks "youtube.com" correctly. Meanwhile the url in the address bar is "https://www.youtube.com/."

But if I remove "https://www." from "https://www.youtube.com/" in the address bar (Not retype), I can actually visit "youtube.com." It means somehow the webfilter is not working properly.

This issue exists in ubuntu and macos with version 92.0(64-bit).

Does anyone have the same problem? Any help would be appreciated.

Suppose I have a "policies.json" file in the "distribution" subdirectory of my Firefox installation. And suppose "policies.json" file contains this: { "policies": { "WebsiteFilter": { "Block": [ "youtube.com", "www.youtube.com", "http://www.youtube.com", "https://www.youtube.com", ] } } } Now if I type "youtube.com" in the address bar, it shows "Your organisation has blocked access to this page or web site." It means firefox blocks "youtube.com" correctly. Meanwhile the url in the address bar is "https://www.youtube.com/." But if I remove "https://www." from "https://www.youtube.com/" in the address bar (Not retype), I can actually visit "youtube.com." It means somehow the webfilter is not working properly. This issue exists in ubuntu and macos with version 92.0(64-bit). Does anyone have the same problem? Any help would be appreciated.

被采纳的解决方案

The Policies page (https://github.com/mozilla/policy-templates#websitefilter) refers to the following page for the format of the URL match patterns:

https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/Match_patterns

It looks like you need all three parts (scheme, host, path). The * character matches both http and https, and any path, so try:

{
  "policies": {
      "WebsiteFilter": {
          "Block": [
            "*://youtube.com/*",
            "*://www.youtube.com/*"
          ]
      }
  }
}


Does that work on yours?

定位到答案原位置 👍 1

所有回复 (3)

more options

选择的解决方案

The Policies page (https://github.com/mozilla/policy-templates#websitefilter) refers to the following page for the format of the URL match patterns:

https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/Match_patterns

It looks like you need all three parts (scheme, host, path). The * character matches both http and https, and any path, so try:

{
  "policies": {
      "WebsiteFilter": {
          "Block": [
            "*://youtube.com/*",
            "*://www.youtube.com/*"
          ]
      }
  }
}


Does that work on yours?

more options

It works. Thank you very much for your help.

PS: Reboot may be required for the updated policies to take effect.

more options

Before rebooting, you also could try the special "Clear Startup Cache" restart button on the right side of the Troubleshooting Information page. That sometimes is needed if startup configuration isn't working correctly.

More info: Use the Troubleshooting Information page to help fix Firefox issues