Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Adds an external Tracking Protection list.
This method is not supported for Windows apps using JavaScript.
![]() |
Syntax
HRESULT retVal = object.msAddTrackingProtectionList(URL, bstrFilterName);
Parameters
URL [in]
Type: BSTRThe address of the Tracking Protection list.
bstrFilterName [in]
Type: BSTRThe display name.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
There are no standards that apply here.
Remarks
A Tracking Protection list is a specially formatted text file that contains the following elements, each on their own line.
Element | Description |
---|---|
msFilterList | File header. This exact keyword must appear by itself on the first line of the file. |
# (hash) | Comment line. This character at the beginning of a line indicates a comment. |
: (colon) | Property rule. The only property rule currently defined is "Expires=N" where N represents the number of days (max 30) to elapse before refreshing the Tracking Protection list from the server. If not specified, the default value is 7 . |
- (hyphen) | Block rule. The block rule can filter strings or domain labels, or a combination of both, as follows:
|
+ (plus) | Allow rule. Only domain labels can be allowed. The allow rule follows the same syntax as the block rule for domains. |
A Tracking Protection list requires at least one valid block or allow rule.
Domain Labels
A domain name consists of one or more parts, called labels, that are concatenated and delimited by dots, such as host.contoso.com
. Domain rules match against each domain label, as follows:
- A block domain rule matches any contiguous domain labels in a domain name, for example,
contoso
,host.contoso
, orcontoso.com
. - An allow domain rule is less permissive than a block rule, and matches only the right-most characters of the URL, such as
contoso.com
.
Domain rules can also specify an optional substring to match. There can be only one substring per domain rule line. Strings can contain a wildcard (*) that matches any number of characters.
For more information and examples of valid Tracking Protection lists, see Web Tracking Protection section 4, List Format.