| 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.tabs.onCreated</code> event | 6 <code>chrome.tabs.onCreated</code> event |
| 7 to be notified whenever there's a new tab: | 7 to be notified whenever there's a new tab: |
| 8 </p> | 8 </p> |
| 9 | 9 |
| 10 <pre> | 10 <pre> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 but the parameters to the function depend on | 25 but the parameters to the function depend on |
| 26 which event you're handling. | 26 which event you're handling. |
| 27 Checking the documentation for | 27 Checking the documentation for |
| 28 <a href="tabs.html#event-onCreated"><code>chrome.tabs.onCreated</code></a>, | 28 <a href="tabs.html#event-onCreated"><code>chrome.tabs.onCreated</code></a>, |
| 29 you can see that the function has a single parameter: | 29 you can see that the function has a single parameter: |
| 30 a <a href="tabs.html#type-tabs.Tab">Tab</a> object | 30 a <a href="tabs.html#type-tabs.Tab">Tab</a> object |
| 31 that has details about the newly created tab. | 31 that has details about the newly created tab. |
| 32 </p> | 32 </p> |
| 33 | 33 |
| 34 | 34 |
| 35 {{^is_apps}} |
| 35 <div class="doc-family extensions"> | 36 <div class="doc-family extensions"> |
| 36 <h2 id="declarative">Declarative Event Handlers</h2> | 37 <h2 id="declarative">Declarative Event Handlers</h2> |
| 37 | 38 |
| 38 <p> | 39 <p> |
| 39 The declarative event handlers provide a means to define rules consisting of | 40 The declarative event handlers provide a means to define rules consisting of |
| 40 declarative conditions and actions. Conditions are evaluated in the browser | 41 declarative conditions and actions. Conditions are evaluated in the browser |
| 41 rather than the JavaScript engine which reduces roundtrip latencies and allows | 42 rather than the JavaScript engine which reduces roundtrip latencies and allows |
| 42 for very high efficiency. | 43 for very high efficiency. |
| 43 </p> | 44 </p> |
| 44 | 45 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 147 |
| 147 <pre> | 148 <pre> |
| 148 var rule_ids = ["id1", "id2", ...]; | 149 var rule_ids = ["id1", "id2", ...]; |
| 149 function getRules(rule_ids, function callback(details) {...}); | 150 function getRules(rule_ids, function callback(details) {...}); |
| 150 </pre> | 151 </pre> |
| 151 | 152 |
| 152 <p> | 153 <p> |
| 153 The <code>details</code> parameter passed to the <code>calback()</code> function | 154 The <code>details</code> parameter passed to the <code>calback()</code> function |
| 154 refers to an array of rules including filled optional parameters. | 155 refers to an array of rules including filled optional parameters. |
| 155 </p> | 156 </p> |
| 156 </div> | 157 </div> |
| OLD | NEW |