OLD | NEW |
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 Loading... |
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> |
170 </li> | 174 </li> |
171 <li> | 175 <li> |
172 <a href="#apiReference">API reference: chrome.events</a> | 176 <a href="#apiReference">API reference: chrome.events</a> |
173 <ol> | 177 <ol> |
174 <li> | 178 <li> |
175 <a href="#types">Types</a> | 179 <a href="#types">Types</a> |
176 <ol> | 180 <ol> |
177 <li> | 181 <li> |
178 <a href="#type-events.Event">events.Event</a> | 182 <a href="#type-events.Event">events.Event</a> |
179 <ol> | 183 <ol> |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 function. | 336 function. |
333 </p> | 337 </p> |
334 <pre>var rule_ids = ["id1", "id2", ...]; | 338 <pre>var rule_ids = ["id1", "id2", ...]; |
335 function getRules(rule_ids, function callback(details) {...}); | 339 function getRules(rule_ids, function callback(details) {...}); |
336 </pre> | 340 </pre> |
337 <p> | 341 <p> |
338 The <code>details</code> parameter passed to the <code>calback()</code> function | 342 The <code>details</code> parameter passed to the <code>calback()</code> function |
339 refers to an array of rules including filled optional parameters. | 343 refers to an array of rules including filled optional parameters. |
340 </p> | 344 </p> |
341 </div> | 345 </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> |
342 </div> | 376 </div> |
343 <!-- API PAGE --> | 377 <!-- API PAGE --> |
344 <div class="apiPage"> | 378 <div class="apiPage"> |
345 <a name="apiReference"></a> | 379 <a name="apiReference"></a> |
346 <h2>API reference: chrome.events</h2> | 380 <h2>API reference: chrome.events</h2> |
347 <!-- PROPERTIES --> | 381 <!-- PROPERTIES --> |
348 <!-- /apiGroup --> | 382 <!-- /apiGroup --> |
349 <!-- METHODS --> | 383 <!-- METHODS --> |
350 <!-- /apiGroup --> | 384 <!-- /apiGroup --> |
351 <!-- EVENTS --> | 385 <!-- EVENTS --> |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 _uff=0; | 1486 _uff=0; |
1453 urchinTracker(); | 1487 urchinTracker(); |
1454 } | 1488 } |
1455 catch(e) {/* urchinTracker not available. */} | 1489 catch(e) {/* urchinTracker not available. */} |
1456 </script> | 1490 </script> |
1457 <!-- end analytics --> | 1491 <!-- end analytics --> |
1458 </div> | 1492 </div> |
1459 </div> <!-- /gc-footer --> | 1493 </div> <!-- /gc-footer --> |
1460 </div> <!-- /gc-container --> | 1494 </div> <!-- /gc-container --> |
1461 </body></html> | 1495 </body></html> |
OLD | NEW |