OLD | NEW |
1 <p> | 1 <p> |
2 The commands API allows you to add keyboard shortcuts that trigger actions in | 2 The commands API allows you to add keyboard shortcuts that trigger actions in |
3 your extension. An action can be opening the browser action or page action popup | 3 your extension. An action can be opening the browser action or page action popup |
4 or sending a command to the extension. | 4 or sending a command to the extension. |
5 </p> | 5 </p> |
6 | 6 |
7 <h2 id="manifest">Manifest</h2> | 7 <h2 id="manifest">Manifest</h2> |
8 <p> | 8 <p> |
9 In addition to the "experimental" permission you must declare the "commands" | 9 In addition to the "experimental" permission you must declare the "commands" |
10 permission in your extension's manifest to use this API and set manifest_version | 10 permission in your extension's manifest to use this API and set manifest_version |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 chrome.experimental.commands.onCommand.addListener(function(command) { | 66 chrome.experimental.commands.onCommand.addListener(function(command) { |
67 console.log('Command:', command); | 67 console.log('Command:', command); |
68 }); | 68 }); |
69 </pre> | 69 </pre> |
70 | 70 |
71 <p>The '_execute_browser_action' and '_execute_page_action' commands are | 71 <p>The '_execute_browser_action' and '_execute_page_action' commands are |
72 reserved for the action of opening your extension's popups. They won't normally | 72 reserved for the action of opening your extension's popups. They won't normally |
73 generate events that you can handle. If you need to take action based on your | 73 generate events that you can handle. If you need to take action based on your |
74 popup opening, consider listening for an 'onDomReady' event inside your popup's | 74 popup opening, consider listening for an 'onDomReady' event inside your popup's |
75 code. | 75 code. |
76 </p> | 76 </p> |
OLD | NEW |