Index: chrome/common/extensions/docs/server2/templates/intros/events.html |
diff --git a/chrome/common/extensions/docs/server2/templates/intros/events.html b/chrome/common/extensions/docs/server2/templates/intros/events.html |
index 709c6f17b88176977a2385e938093819097ea227..239380439372c24939915a942cc325bc3ce00d74 100644 |
--- a/chrome/common/extensions/docs/server2/templates/intros/events.html |
+++ b/chrome/common/extensions/docs/server2/templates/intros/events.html |
@@ -155,4 +155,48 @@ The <code>details</code> parameter passed to the <code>calback()</code> function |
refers to an array of rules including filled optional parameters. |
</p> |
</div> |
+{{/is_apps}} |
+ |
+{{^is_apps}} |
+<div class="doc-family extensions"> |
+<h2 id="filtered">Filtered events</h2> |
+ |
+<p>Filtered events are a mechanism that allows listeners to specify a subset of |
+events that they are interested in. A listener that makes use of a filter won't |
+be invoked for events that don't pass the filter, which makes the listening |
+code more declarative and efficient - an <a href="event_pages.html">event |
+ page</a> page need not be woken up to handle events it doesn't care |
+about.</p> |
+ |
+<p>Filtered events are intended to allow a transition from manual filtering |
+code like this:</p> |
+ |
+<pre> |
+chrome.webNavigation.onCommitted.addListener(function(e) { |
+ if (hasHostSuffix(e.url, 'google.com') || |
+ hasHostSuffix(e.url, 'google.com.au')) { |
+ // ... |
+ } |
+}); |
+</pre> |
+ |
+<p>into this:</p> |
+ |
+<pre> |
+chrome.webNavigation.onCommitted.addListener(function(e) { |
+ // ... |
+}, {url: [{hostSuffix: 'google.com'}, |
+ {hostSuffix: 'google.com.au'}]}); |
+</pre> |
+ |
+<p>Events support specific filters that are meaningful to that event. The list |
+of filters that an event supports will be listed in the documentation for that |
+event in the "filters" section.</p> |
+ |
+<p>When matching URLs (as in the example above), event filters support the same |
+URL matching capabilities as expressable with a <a |
+ href="events.html#type-UrlFilter">UrlFilter</a>, except for scheme and port |
+matching.</p> |
+ |
+</div> |
{{/is_apps}} |