• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<div id="pageData-name" class="pageData">Context Menus</div>
2
3<!-- BEGIN AUTHORED CONTENT -->
4<p>
5The context menus module allows you
6to add items to Google Chrome's context menu.
7</p>
8
9<p>
10You can choose what types of objects
11your context menu additions apply to,
12such as images, hyperlinks, and pages.
13</P>
14
15<p>
16You can create as many context menu items
17as you need, but if more than one
18from your extension is visible at once,
19Google Chrome automatically collapses them
20into a single parent menu.
21</p>
22
23<h2 id="manifest">Manifest</h2>
24<p>You must declare the "contextMenus" permission
25in your extension's manifest to use the API.
26Also, you should specify a 16x16-pixel icon
27for display next to your menu item.
28For example:
29</p>
30
31<pre>{
32  "name": "My extension",
33  ...
34  "permissions": [
35    <b>"contextMenus"</b>
36  ],
37  "icons": {
38    <b>"16": "icon-bitty.png",</b>
39    "48": "icon-small.png",
40    "128": "icon-large.png"
41  },
42  ...
43}</pre>
44
45<h2 id="examples">Examples</h2>
46
47<p>
48You can find samples of this API on the
49<a href="samples.html#contextMenus">sample page</a>.
50
51<!-- END AUTHORED CONTENT -->
52