Home | History | Annotate | Download | only in intros
      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>You must declare the "contextMenus" permission
     22 in your extension's manifest to use the API.
     23 Also, you should specify a 16x16-pixel icon
     24 for display next to your menu item.
     25 For example:
     26 </p>
     27 
     28 <pre>{
     29   "name": "My extension",
     30   ...
     31   "permissions": [
     32     <b>"contextMenus"</b>
     33   ],
     34   "icons": {
     35     <b>"16": "icon-bitty.png",</b>
     36     "48": "icon-small.png",
     37     "128": "icon-large.png"
     38   },
     39   ...
     40 }</pre>
     41 
     42 <h2 id="examples">Examples</h2>
     43 
     44 <p>
     45 You can find samples of this API on the
     46 <a href="samples.html#contextMenus">sample page</a>.
     47