Utils.addAutoFilter
Adds a filter to one of the lists that either blocks certain URLs (denylist), or allows only specific URLs (allowlist).
The URL of each HTTP request is checked first against the denylist, and then the allowlist. HTTP requests that do not pass the check are blocked.
Utils.addAutoFilter(url, isIncluded);
Arguments
| Name | Description |
|---|---|
url | (string or regexp) String or regular expression that represents the URL. |
| isIncluded | (boolean) Set to true to add the URL to the allowlist, or false to add the URL to the denylist. |
Return value
A promise that will be fulfilled with no arguments.
Examples
The specified domain is added to the allowlist. All other domains are blocked.
String example:
Utils.addAutoFilter("http://www.myco.com/*", true);Regular expression example:
Utils.addAutoFilter(/^http:\/\/www\.myco\.com\/.*/, true);

