This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Rohkem teavet

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.

Valitud lahendus

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?

Loe vastust kontekstis 👍 1

All Replies (3)

more options

Valitud lahendus

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