OLD | NEW |
1 <div id="pageData-name" class="pageData">Commands</div> | |
2 | |
3 <!-- BEGIN AUTHORED CONTENT --> | |
4 | |
5 <p> | 1 <p> |
6 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 |
7 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 |
8 or sending a command to the extension. | 4 or sending a command to the extension. |
9 </p> | 5 </p> |
10 | 6 |
11 <h2 id="manifest">Manifest</h2> | 7 <h2 id="manifest">Manifest</h2> |
12 <p> | 8 <p> |
13 In addition to the "experimental" permission you must declare the "commands" | 9 In addition to the "experimental" permission you must declare the "commands" |
14 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... |
70 chrome.experimental.commands.onCommand.addListener(function(command) { | 66 chrome.experimental.commands.onCommand.addListener(function(command) { |
71 console.log('Command:', command); | 67 console.log('Command:', command); |
72 }); | 68 }); |
73 </pre> | 69 </pre> |
74 | 70 |
75 <p>The '_execute_browser_action' and '_execute_page_action' commands are | 71 <p>The '_execute_browser_action' and '_execute_page_action' commands are |
76 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 |
77 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 |
78 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 |
79 code. | 75 code. |
80 </p> | 76 </p> |
81 <!-- END AUTHORED CONTENT --> | |
OLD | NEW |