| 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. Note: Combinations | 9 the manifest as an attribute of the 'commands' manifest key. Note: Combinations |
| 32 that involve Ctrl+Alt are not permitted in order to avoid conflicts with the | 10 that involve Ctrl+Alt are not permitted in order to avoid conflicts with the |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 console.log('Command:', command); | 54 console.log('Command:', command); |
| 77 }); | 55 }); |
| 78 </pre> | 56 </pre> |
| 79 | 57 |
| 80 <p>The '_execute_browser_action' and '_execute_page_action' commands are | 58 <p>The '_execute_browser_action' and '_execute_page_action' commands are |
| 81 reserved for the action of opening your extension's popups. They won't normally | 59 reserved for the action of opening your extension's popups. They won't normally |
| 82 generate events that you can handle. If you need to take action based on your | 60 generate events that you can handle. If you need to take action based on your |
| 83 popup opening, consider listening for an 'onDomReady' event inside your popup's | 61 popup opening, consider listening for an 'onDomReady' event inside your popup's |
| 84 code. | 62 code. |
| 85 </p> | 63 </p> |
| OLD | NEW |