Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chrome/common/extensions/docs/apps/events.html

Issue 10826295: Revert 151420 - Add documentation for filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note: 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note:
2 1) The <head> information in this page is significant, should be uniform 2 1) The <head> information in this page is significant, should be uniform
3 across api docs and should be edited only with knowledge of the 3 across api docs and should be edited only with knowledge of the
4 templating mechanism. 4 templating mechanism.
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a
6 browser, it will be re-generated from the template, json schema and 6 browser, it will be re-generated from the template, json schema and
7 authored overview content. 7 authored overview content.
8 4) The <body>.innerHTML is also generated by an offline step so that this 8 4) The <body>.innerHTML is also generated by an offline step so that this
9 page may easily be indexed by search engines. 9 page may easily be indexed by search engines.
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head>
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 <h1 class="page_title">chrome.events</h1> 160 <h1 class="page_title">chrome.events</h1>
161 </div> 161 </div>
162 <!-- TABLE OF CONTENTS --> 162 <!-- TABLE OF CONTENTS -->
163 <div id="toc"> 163 <div id="toc">
164 <h2>Contents</h2> 164 <h2>Contents</h2>
165 <ol> 165 <ol>
166 <li> 166 <li>
167 <a href="#declarative">Declarative Event Handlers</a> 167 <a href="#declarative">Declarative Event Handlers</a>
168 <ol> 168 <ol>
169 </ol> 169 </ol>
170 </li><li>
171 <a href="#filtered">Filtered events</a>
172 <ol>
173 </ol>
174 </li> 170 </li>
175 <li> 171 <li>
176 <a href="#apiReference">API reference: chrome.events</a> 172 <a href="#apiReference">API reference: chrome.events</a>
177 <ol> 173 <ol>
178 <li> 174 <li>
179 <a href="#types">Types</a> 175 <a href="#types">Types</a>
180 <ol> 176 <ol>
181 <li> 177 <li>
182 <a href="#type-events.Event">events.Event</a> 178 <a href="#type-events.Event">events.Event</a>
183 <ol> 179 <ol>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 function. 332 function.
337 </p> 333 </p>
338 <pre>var rule_ids = ["id1", "id2", ...]; 334 <pre>var rule_ids = ["id1", "id2", ...];
339 function getRules(rule_ids, function callback(details) {...}); 335 function getRules(rule_ids, function callback(details) {...});
340 </pre> 336 </pre>
341 <p> 337 <p>
342 The <code>details</code> parameter passed to the <code>calback()</code> function 338 The <code>details</code> parameter passed to the <code>calback()</code> function
343 refers to an array of rules including filled optional parameters. 339 refers to an array of rules including filled optional parameters.
344 </p> 340 </p>
345 </div> 341 </div>
346 <div class="doc-family extensions">
347 <h2 id="filtered">Filtered events</h2>
348 <p>Filtered events are a mechanism that allows listeners to specify a subset of
349 events that they are interested in. A listener that makes use of a filter won't
350 be invoked for events that don't pass the filter, which makes the listening
351 code more declarative and efficient - an <a href="event_pages.html">event
352 page</a> page need not be woken up to handle events it doesn't care
353 about.</p>
354 <p>Filtered events are intended to allow a transition from manual filtering
355 code like this:</p>
356 <pre>chrome.webNavigation.onCommitted.addListener(function(e) {
357 if (hasHostSuffix(e.url, 'google.com') ||
358 hasHostSuffix(e.url, 'google.com.au')) {
359 // ...
360 }
361 });
362 </pre>
363 <p>into this:</p>
364 <pre>chrome.webNavigation.onCommitted.addListener(function(e) {
365 // ...
366 }, {url: [{hostSuffix: 'google.com'},
367 {hostSuffix: 'google.com.au'}]});
368 </pre>
369 <p>Events support specific filters that are meaningful to that event. The list
370 of filters that an event supports will be listed in the documentation for that
371 event in the "filters" section.</p>
372 <p>When matching URLs (as in the example above), event filters support the same
373 URL matching capabilities as expressable with a <a href="events.html#type-UrlFil ter">UrlFilter</a>, except for scheme and port
374 matching.</p>
375 </div>
376 </div> 342 </div>
377 <!-- API PAGE --> 343 <!-- API PAGE -->
378 <div class="apiPage"> 344 <div class="apiPage">
379 <a name="apiReference"></a> 345 <a name="apiReference"></a>
380 <h2>API reference: chrome.events</h2> 346 <h2>API reference: chrome.events</h2>
381 <!-- PROPERTIES --> 347 <!-- PROPERTIES -->
382 <!-- /apiGroup --> 348 <!-- /apiGroup -->
383 <!-- METHODS --> 349 <!-- METHODS -->
384 <!-- /apiGroup --> 350 <!-- /apiGroup -->
385 <!-- EVENTS --> 351 <!-- EVENTS -->
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 _uff=0; 1452 _uff=0;
1487 urchinTracker(); 1453 urchinTracker();
1488 } 1454 }
1489 catch(e) {/* urchinTracker not available. */} 1455 catch(e) {/* urchinTracker not available. */}
1490 </script> 1456 </script>
1491 <!-- end analytics --> 1457 <!-- end analytics -->
1492 </div> 1458 </div>
1493 </div> <!-- /gc-footer --> 1459 </div> <!-- /gc-footer -->
1494 </div> <!-- /gc-container --> 1460 </div> <!-- /gc-container -->
1495 </body></html> 1461 </body></html>
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/web_navigation.json ('k') | chrome/common/extensions/docs/extensions/alarms.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698