OLD | NEW |
1 <h2 id="manifest">Manifest</h2> | 1 <h2 id="manifest">Manifest</h2> |
2 <p> | 2 <p> |
3 You must have a <code>"manifest_version"</code> of at least <code>2</code> to us
e this API. | 3 You must have a <code>"manifest_version"</code> of at least <code>2</code> to us
e this API. |
4 </p> | 4 </p> |
5 | 5 |
6 {{?is_apps +partials.warning_dev /}} | 6 {{?is_apps +partials.warning_dev /}} |
7 | 7 |
8 <h2 id="usage">Usage</h2> | 8 <h2 id="usage">Usage</h2> |
9 <p>The commands API allows you to define specific commands, and bind them to a | 9 <p>The commands API allows you to define specific commands, and bind them to a |
10 default key combination. Each command your extension accepts must be listed in | 10 default key combination. Each command your extension accepts must be listed in |
11 the manifest as an attribute of the 'commands' manifest key. An extension can | 11 the manifest as an attribute of the 'commands' manifest key. An extension can |
12 have many commands but only 4 suggested keys can be specified. The user can | 12 have many commands but only 4 suggested keys can be specified. The user can |
13 manually add more shortcuts from the chrome://extensions/configureCommands | 13 manually add more shortcuts from the chrome://extensions/configureCommands |
14 dialog.</p> | 14 dialog.</p> |
15 | 15 |
16 <p>Supported keys: A-Z, 0-9, Comma, Period, Home, End, PageUp, PageDown, Insert, | 16 <p>Supported keys: A-Z, 0-9, Comma, Period, Home, End, PageUp, PageDown, Insert, |
17 Delete, Arrow keys (Up, Down, Left, Right) and the Media Keys | 17 Delete, Arrow keys (Up, Down, Left, Right) and the Media Keys |
18 (MediaNextTrack, MediaPlayPause, MediaPrevTrack, MediaStop).</p> | 18 (MediaNextTrack, MediaPlayPause, MediaPrevTrack, MediaStop).</p> |
19 | 19 |
20 <p>Note: All key combinations must include either Ctrl* or Alt. Combinations | 20 <p>Note: All key combinations must include either Ctrl* or Alt. Combinations |
21 that involve Ctrl+Alt are not permitted in order to avoid conflicts with the | 21 that involve Ctrl+Alt are not permitted in order to avoid conflicts with the |
22 AltGr key. Shift can be used in addition to Alt or Ctrl, but is not required. | 22 AltGr key. Shift can be used in addition to Alt or Ctrl, but is not required. |
23 Modifiers (such as Ctrl) can not be used in combination with the Media Keys. | 23 Modifiers (such as Ctrl) can not be used in combination with the Media Keys. |
24 Tab key was removed from list of supported keys in Chrome version 33 and above | 24 Tab key was removed from list of supported keys in Chrome version 33 and above |
25 for accessibility reasons.<p> | 25 for accessibility reasons.<p> |
26 | 26 |
27 <p>* Also note that on Mac 'Ctrl' is automatically converted to 'Command'. If | 27 <p>* Also note that on Mac 'Ctrl' is automatically converted to 'Command'. If |
28 you want 'Ctrl' instead, please specify 'MacCtrl'.</p> | 28 you want 'Ctrl' instead, please specify 'MacCtrl'.</p> |
29 | 29 |
| 30 <p>* Additionally, on Chrome OS, you can specify Search as a modifier.</p> |
| 31 |
30 <p>Certain Chrome shortcuts (e.g. window management) always take priority over | 32 <p>Certain Chrome shortcuts (e.g. window management) always take priority over |
31 Extension Command shortcuts and can not be overwritten.</p> | 33 Extension Command shortcuts and can not be overwritten.</p> |
32 | 34 |
33 <pre data-filename="manifest.json"> | 35 <pre data-filename="manifest.json"> |
34 { | 36 { |
35 "name": "My extension", | 37 "name": "My extension", |
36 ... | 38 ... |
37 <b> "commands": { | 39 <b> "commands": { |
38 "toggle-feature-foo": { | 40 "toggle-feature-foo": { |
39 "suggested_key": { | 41 "suggested_key": { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 "toggle-feature-foo": { | 104 "toggle-feature-foo": { |
103 "suggested_key": { | 105 "suggested_key": { |
104 "default": "Ctrl+Shift+5" | 106 "default": "Ctrl+Shift+5" |
105 }, | 107 }, |
106 "description": "Toggle feature foo", | 108 "description": "Toggle feature foo", |
107 <b>"global": true</b> | 109 <b>"global": true</b> |
108 } | 110 } |
109 }, | 111 }, |
110 ... | 112 ... |
111 }</pre> | 113 }</pre> |
OLD | NEW |