Export (0) Print
Expand All

IShellUIHelper4::msAddTrackingProtectionList Method

New for Windows Internet Explorer 9

Adds an external Tracking Protection list.

Syntax


HRESULT msAddTrackingProtectionList(
    BSTR URL,
    BSTR bstrFilterName
);

Parameters

URL
[in] The address of the Tracking Protection list.
bstrFilterName
[in] The display name.

Return Value

Returns S_OK if successful, or an error value otherwise.

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:
  • If the block character is followed by whitespace and a string, the rule blocks downloads of any resource that contains the string in its URL.
  • If the block character is followed by d, whitespace, and a domain label, the rule blocks domains according to rules described in the Domain Labels section.
  • If a block domain rule is followed by whitespace and a string, the domain request is blocked only if the URL contains the specified string.
+ (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, or contoso.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.

See Also

IShellUIHelper4::msTrackingProtectionEnabled

Community Additions

ADD
Show:
© 2014 Microsoft