.gif)
Note: This documentation is preliminary and is subject to change.
Subscribe to an InPrivate Blocking feed.
Syntax
window.external.AddInPrivateSubscription(URL, bstrFilterName)
Parameters
| URL |
Required.
The URL of an Atom or Really Simple Syndication (RSS) feed.
Note The URL parameter allows only http: and https: protocol schemes. |
| bstrFilterName |
Required.
The Web Filter title displayed in Manage Add-ons. |
Return Value
No return value.
Remarks
InPrivate Blocking subscriptions are active only in InPrivate Browsing sessions, and they do not block content while InPrivate Browsing is off. To start InPrivate Browsing, select InPrivate Browsing from the Safety menu in Internet Explorer. InPrivate Blocking compares third-party URLs (resources hosted in different domains) against the rules in the filter file, and either blocks or allows the navigation. Top-level navigations are unaffected.
The following RSS elements are required by the InPrivate Blocking subscription feed.
| RSS "channel" sub-element | Atom "feed" sub-element | Description |
|---|
| title | title | Title of the filter feed. |
| link | link | URL of the filter author. |
| description | subtitle | Description of what the filter does. |
|
|---|
Each feed item may contain zero, one, or both of the at:allowRegex and at:blockRegex elements. These elements contain one or more CDATAs, which contain exactly one regular expression. Characters in the URL that have special meaning to the regular expression, such as dots ('.') and path separators ('/'), must be escaped with a backslash ('\').
| RSS "item" sub-element | Atom "entry" sub-element | Description |
|---|
| description | summary | Body of the feed item. |
| wf:allowRegex | wf:allowRegex | Defines an "allow" expression. |
| wf:blockRegex | wf:blockRegex | Defines a "block" (deny) expression. |
Multiple items are allowed in the filter feed. All at:allowRegex elements are merged into a single "allow" expression for the web filter. Similarly, all at:blockRegex elements are merged into a single "block" expression. These regular expressions allow or block third-party URLs that match the specified patterns.
Examples
AddInPrivateSubscription can be called from script in response to an event (such as clicking a button) as in the following example.
<script type="text/javascript">
function doFilter() {
window.external.AddInPrivateSubscription (
"http://msdntest/WebFilterSub.xml",
"InPrivate Blocking Subscription");
}
</script>
<form method="post">
<input type="button" onclick="doFilter()"
value="Add InPrivate Blocking Subscription" />
</form>
The following filter file contains a single blocking rule that prevents navigation to "ads.contoso.com" resources. The file is in RSS 2.0 format.
<rss version="2.0" xmlns:wf="http://www.microsoft.com/schemas/webfilter/2008">
<channel>
<title>Contoso.com InPrivate Browsing Web Filter</title>
<link>http://www.contoso.com/</link>
<description>Protect your privacy by blocking ads from our site. </description>
<item>
<description>This item blocks ads from Contoso.com. </description>
<wf:blockRegex> <![CDATA[ads.contoso.com\/.*]]> </wf:blockRegex>
</item>
</channel>
</rss>
Here is the same file in Atom format.
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:wf="http://www.microsoft.com/schemas/webfilter/2008">
<title>Contoso.com InPrivate Browsing Web Filter</title>
<link>http://www.contoso.com/</link>
<subtitle>Protect your privacy by blocking ads from our site. </subtitle>
<entry>
<summary>This item blocks ads from Contoso.com. </summary>
<wf:blockRegex> <![CDATA[ads.contoso.com\/.*]]> </wf:blockRegex>
</entry>
</feed>
Applies To