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