web.addFilter

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
urlthe specific URL to filter
urlPrefixFilter 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"
hostURLs which include host in the hostname portion of the URL path are filtered
hostPrefixURLs which include this prefix in the hostname portion of the URL path are filtered
hostSuffixURLs which include this suffix in the host name portion of the URL path are filtered
pathURLs with the specified path are filtered
pathPrefixURLs with the specified path prefix are filtered
pathSuffixURLs with the specified path suffix are filtered
portURLs from the specified port are filtered
schemeURLs with the specified communications scheme, such as http, https and ftp, are filtered
queryURLs with the specified query are filtered
queryPrefixURLs with the specified query prefix are filtered
querySuffixURLs with the specified query suffix are filtered
fragmentIdURLs containing a matching fragment id are filtered
fragmentIdPrefixURLs containing a matching fragment id prefix are filtered
fragmentIdSuffixURLs 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(...)