| OLD | NEW |
| 1 <p> | 1 <p> |
| 2 An <code>Event</code> is an object | 2 An <code>Event</code> is an object |
| 3 that allows you to be notified | 3 that allows you to be notified |
| 4 when something interesting happens. | 4 when something interesting happens. |
| 5 Here's an example of using the | 5 Here's an example of using the |
| 6 <code>chrome.alarms.onAlarm</code> event | 6 <code>chrome.alarms.onAlarm</code> event |
| 7 to be notified whenever an alarm has elapsed: | 7 to be notified whenever an alarm has elapsed: |
| 8 </p> | 8 </p> |
| 9 | 9 |
| 10 <pre> | 10 <pre> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 is always a function that you define to handle the event, | 22 is always a function that you define to handle the event, |
| 23 but the parameters to the function depend on | 23 but the parameters to the function depend on |
| 24 which event you're handling. | 24 which event you're handling. |
| 25 Checking the documentation for | 25 Checking the documentation for |
| 26 $ref:alarms.onAlarm, | 26 $ref:alarms.onAlarm, |
| 27 you can see that the function has a single parameter: | 27 you can see that the function has a single parameter: |
| 28 an $ref:alarms.Alarm object | 28 an $ref:alarms.Alarm object |
| 29 that has details about the elapsed alarm. | 29 that has details about the elapsed alarm. |
| 30 </p> | 30 </p> |
| 31 | 31 |
| 32 Example APIs using Events: |
| 33 $ref:alarms, |
| 34 {{?is_apps}} |
| 35 $ref:app.runtime, |
| 36 $ref:app.window, |
| 37 {{/is_apps}} |
| 38 $ref:i18n, |
| 39 $ref:identity, |
| 40 $ref:runtime. |
| 41 Most <a href="api_index.html">chrome APIs</a> do. |
| 32 | 42 |
| 33 {{^is_apps}} | 43 {{^is_apps}} |
| 34 <div class="doc-family extensions"> | 44 <div class="doc-family extensions"> |
| 35 <h2 id="declarative">Declarative Event Handlers</h2> | 45 <h2 id="declarative">Declarative Event Handlers</h2> |
| 36 | 46 |
| 37 <p> | 47 <p> |
| 38 The declarative event handlers provide a means to define rules consisting of | 48 The declarative event handlers provide a means to define rules consisting of |
| 39 declarative conditions and actions. Conditions are evaluated in the browser | 49 declarative conditions and actions. Conditions are evaluated in the browser |
| 40 rather than the JavaScript engine which reduces roundtrip latencies and allows | 50 rather than the JavaScript engine which reduces roundtrip latencies and allows |
| 41 for very high efficiency. | 51 for very high efficiency. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 of filters that an event supports will be listed in the documentation for that | 264 of filters that an event supports will be listed in the documentation for that |
| 255 event in the "filters" section.</p> | 265 event in the "filters" section.</p> |
| 256 | 266 |
| 257 <p>When matching URLs (as in the example above), event filters support the same | 267 <p>When matching URLs (as in the example above), event filters support the same |
| 258 URL matching capabilities as expressible with a | 268 URL matching capabilities as expressible with a |
| 259 $ref:events.UrlFilter, except for scheme and port | 269 $ref:events.UrlFilter, except for scheme and port |
| 260 matching.</p> | 270 matching.</p> |
| 261 | 271 |
| 262 </div> | 272 </div> |
| 263 {{/is_apps}} | 273 {{/is_apps}} |
| OLD | NEW |