Share this page

# web.addFilter

Filter Functions

Sets criteria to include or exclude URLs when downloading the response to the next action function.

## Syntax

     web.addFilter( {object} ) ;

## JavaScript Object

    {
       action:<string>",
       url:"<string>",
       urlPrefix:"<string>",
       host:"<string>",
       hostPrefix:"<string>",
       hostSuffix:"<string>",
       path:"<string>",
       pathPrefix:"<string>",
       pathSuffix:"<string>",
       port:"<string>",
       scheme:"<string>",
       query:"<string>",
       queryPrefix:"<string>",
       querySuffix:"<string>",
       fragmentId:"<string>",
       fragmentIdPrefix:"<string>",
       fragmentIdSuffix:"<string>"
    }

Property Name | Description
--- | ---
action | A value indicating whether to include or exclude urls matching the filter criteria. The following values are supported: – Include: include only urls which match the criteria – Exclude: exclude urls which match the criteria. This is the default value
url | the specific URL to filter
urlPrefix | Filter all URLs that begin with this string. For example, "urlPrefix = http://www.cc" filters http://www.ccn.com, http://www.cc.edu, http://cc–nanochem.de, and any other URL that begins with "http://www.cc"
host | URLs which include host in the hostname portion of the URL path are filtered
hostPrefix | URLs which include this prefix in the hostname portion of the URL path are filtered
hostSuffix | URLs which include this suffix in the host name portion of the URL path are filtered
path | URLs with the specified path are filtered
pathPrefix | URLs with the specified path prefix are filtered
pathSuffix | URLs with the specified path suffix are filtered
port | URLs from the specified port are filtered
scheme | URLs with the specified communications scheme, such as http, https and ftp, are filtered
query | URLs with the specified query are filtered
queryPrefix | URLs with the specified query prefix are filtered
querySuffix | URLs with the specified query suffix are filtered
fragmentId | URLs containing a matching fragment id are filtered
fragmentIdPrefix | URLs containing a matching fragment id prefix are filtered
fragmentIdSuffix | URLs containing a matching fragment id suffix are filtered

## Return Values

Not applicable

## Parameterization

All attributes from the list of attributes can be parameterized using standard parameterization.

## General Information

web.addFilter specifies a filter to be used when downloading content in the next action function. Depending on the action attribute passed in this function, the filter will either include or exclude URLs containing the matching criteria. The default action is "action=Exclude".

If the port attribute is set, then only content whose source is that port is downloaded. If no port is specified, then all ports are considered a match.

## Example

    // Call to web_add_filter only applies to the next action function
    web.addFilter({action:"Exclude", pathPrefix:"/Images/Upload"});
    web.customRequest(...)

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