1 <h2 id="usage">Usage</h2> 2 3 <p> 4 Context menu items can appear in any document 5 (or frame within a document), 6 even those with file:// or chrome:// URLs. 7 To control which documents your items can appear in, 8 specify the documentUrlPatterns field 9 when you call the create() or update() method. 10 </p> 11 12 <p> 13 You can create as many context menu items 14 as you need, but if more than one 15 from your extension is visible at once, 16 Google Chrome automatically collapses them 17 into a single parent menu. 18 </p> 19 20 <h2 id="manifest">Manifest</h2> 21 <p> 22 You must declare the "contextMenus" permission 23 in your {{platform}}'s manifest to use the API. 24 {{^is_apps}} 25 Also, you should specify a 16x16-pixel icon 26 for display next to your menu item. 27 {{/is_apps}} 28 For example: 29 </p> 30 31 <pre data-filename="manifest.json"> 32 { 33 "name": "My extension", 34 ... 35 "permissions": [ 36 <b>"contextMenus"</b> 37 ], 38 {{^is_apps}} 39 "icons": { 40 <b>"16": "icon-bitty.png",</b> 41 "48": "icon-small.png", 42 "128": "icon-large.png" 43 }, 44 {{/is_apps}} 45 ... 46 } 47 </pre> 48 49 <h2 id="examples">Examples</h2> 50 51 <p> 52 You can find samples of this API on the 53 <a href="samples#contextMenus">sample page</a>. 54