OLD | NEW |
1 <table class="intro"> | |
2 <tr> | |
3 <th scope="col"></th> | |
4 <th scope="col"></th> | |
5 </tr> | |
6 <tr> | |
7 <td><strong>Description:</strong></td> | |
8 <td>Use the commands API to add keyboard shortcuts | |
9 that trigger actions in your extension, | |
10 for example, an action to open the browser action | |
11 or send a command to the extension.</td> | |
12 </tr> | |
13 <tr> | |
14 <td><strong>Availability:</strong></td> | |
15 <td>Google Chrome 25</td> | |
16 </tr> | |
17 <tr> | |
18 <td><strong>Permissions:</strong></td> | |
19 <td>None</td> | |
20 </tr> | |
21 </table> | |
22 | |
23 <h2 id="manifest">Manifest</h2> | 1 <h2 id="manifest">Manifest</h2> |
24 <p> | 2 <p> |
25 You must set manifest_version to (at least) 2 to use this API. | 3 You must set manifest_version to (at least) 2 to use this API. |
26 </p> | 4 </p> |
27 | 5 |
28 <h2 id="usage">Usage</h2> | 6 <h2 id="usage">Usage</h2> |
29 <p>The commands API allows you to define specific commands, and bind them to a | 7 <p>The commands API allows you to define specific commands, and bind them to a |
30 default key combination. Each command your extension accepts must be listed in | 8 default key combination. Each command your extension accepts must be listed in |
31 the manifest as an attribute of the 'commands' manifest key. An extension can | 9 the manifest as an attribute of the 'commands' manifest key. An extension can |
32 have many commands but only 4 suggested keys can be specified. The user can | 10 have many commands but only 4 suggested keys can be specified. The user can |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 console.log('Command:', command); | 62 console.log('Command:', command); |
85 }); | 63 }); |
86 </pre> | 64 </pre> |
87 | 65 |
88 <p>The '_execute_browser_action' and '_execute_page_action' commands are | 66 <p>The '_execute_browser_action' and '_execute_page_action' commands are |
89 reserved for the action of opening your extension's popups. They won't normally | 67 reserved for the action of opening your extension's popups. They won't normally |
90 generate events that you can handle. If you need to take action based on your | 68 generate events that you can handle. If you need to take action based on your |
91 popup opening, consider listening for an 'onDomReady' event inside your popup's | 69 popup opening, consider listening for an 'onDomReady' event inside your popup's |
92 code. | 70 code. |
93 </p> | 71 </p> |
OLD | NEW |