OLD | NEW |
1 <p> | 1 <p> |
2 The context menus module allows you | 2 The context menus module allows you |
3 to add items to Google Chrome's context menu. | 3 to add items to Google Chrome's context menu. |
4 </p> | 4 </p> |
5 | 5 |
6 <p> | 6 <p> |
7 You can choose what types of objects | 7 You can choose what types of objects |
8 your context menu additions apply to, | 8 your context menu additions apply to, |
9 such as images, hyperlinks, and pages. | 9 such as images, hyperlinks, and pages. |
10 </p> | 10 </p> |
11 | 11 |
12 <p> | 12 <p> |
13 You can create as many context menu items | 13 You can create as many context menu items |
14 as you need, but if more than one | 14 as you need, but if more than one |
15 from your extension is visible at once, | 15 from your extension is visible at once, |
16 Google Chrome automatically collapses them | 16 Google Chrome automatically collapses them |
17 into a single parent menu. | 17 into a single parent menu. |
18 </p> | 18 </p> |
19 | 19 |
20 <p> | 20 <p> |
21 Context menu items can appear in any document | 21 Context menu items can appear in any document |
22 (or frame within a document), | 22 (or frame within a document), |
23 even those with file:// or chrome:// URLs. | 23 even those with file:// or chrome:// URLs. |
24 To control which documents your items can appear in, | 24 To control which documents your items can appear in, |
25 specify the documentUrlPatterns field | 25 specify the documentUrlPatterns field |
26 when you call the create() or update() method. | 26 when you call the create() or update() method. |
27 </p> | 27 </p> |
28 | 28 |
29 <p class="note"> | |
30 <strong>Version note:</strong> | |
31 Before Chrome 14, | |
32 your items could appear only in documents with http:// | |
33 or https:// URLs. | |
34 </p> | |
35 | |
36 <h2 id="manifest">Manifest</h2> | 29 <h2 id="manifest">Manifest</h2> |
37 <p>You must declare the "contextMenus" permission | 30 <p>You must declare the "contextMenus" permission |
38 in your extension's manifest to use the API. | 31 in your extension's manifest to use the API. |
39 Also, you should specify a 16x16-pixel icon | 32 Also, you should specify a 16x16-pixel icon |
40 for display next to your menu item. | 33 for display next to your menu item. |
41 For example: | 34 For example: |
42 </p> | 35 </p> |
43 | 36 |
44 <pre>{ | 37 <pre>{ |
45 "name": "My extension", | 38 "name": "My extension", |
46 ... | 39 ... |
47 "permissions": [ | 40 "permissions": [ |
48 <b>"contextMenus"</b> | 41 <b>"contextMenus"</b> |
49 ], | 42 ], |
50 "icons": { | 43 "icons": { |
51 <b>"16": "icon-bitty.png",</b> | 44 <b>"16": "icon-bitty.png",</b> |
52 "48": "icon-small.png", | 45 "48": "icon-small.png", |
53 "128": "icon-large.png" | 46 "128": "icon-large.png" |
54 }, | 47 }, |
55 ... | 48 ... |
56 }</pre> | 49 }</pre> |
57 | 50 |
58 <h2 id="examples">Examples</h2> | 51 <h2 id="examples">Examples</h2> |
59 | 52 |
60 <p> | 53 <p> |
61 You can find samples of this API on the | 54 You can find samples of this API on the |
62 <a href="samples.html#contextMenus">sample page</a>. | 55 <a href="samples.html#contextMenus">sample page</a>. |
OLD | NEW |