Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / common / extensions / docs / templates / intros / contextMenus.html
blobf460cf1ab59e4f0642ed188d703d63b92003923b
1 <h2 id="usage">Usage</h2>
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>
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>
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>
31 <pre data-filename="manifest.json">
33 "name": "My extension",
34 ...
35 "permissions": [
36 <b>"contextMenus"</b>
38 {{^is_apps}}
39 "icons": {
40 <b>"16": "icon-bitty.png",</b>
41 "48": "icon-small.png",
42 "128": "icon-large.png"
44 {{/is_apps}}
45 ...
47 </pre>
49 <h2 id="examples">Examples</h2>
51 <p>
52 You can find samples of this API on the
53 <a href="samples.html#contextMenus">sample page</a>.