Share this page

# UtilsA.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.

    UtilsA.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:

Copy code

    UtilsA.addAutoFilter("http://www.myco.com/*", true).then(function(){
      TCA.done();
    }).catch(function (error) {
      TCA.doneWithError(error);
    });

Regular expression example:

Copy code

    UtilsA.addAutoFilter(/^http:\/\/www\.myco\.com\/.*/, true).then(function(){
      TCA.done();
    }).catch(function (error) {
      TCA.doneWithError(error);
    });

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: