OLD | NEW |
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: |
2 1) The <head> information in this page is significant, should be uniform | 2 1) The <head> information in this page is significant, should be uniform |
3 across api docs and should be edited only with knowledge of the | 3 across api docs and should be edited only with knowledge of the |
4 templating mechanism. | 4 templating mechanism. |
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a |
6 browser, it will be re-generated from the template, json schema and | 6 browser, it will be re-generated from the template, json schema and |
7 authored overview content. | 7 authored overview content. |
8 4) The <body>.innerHTML is also generated by an offline step so that this | 8 4) The <body>.innerHTML is also generated by an offline step so that this |
9 page may easily be indexed by search engines. | 9 page may easily be indexed by search engines. |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> |
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> |
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | 13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> |
14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> | 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> |
15 </script> | 15 </script> |
16 <script type="text/javascript" src="js/api_page_generator.js"></script> | 16 <script type="text/javascript" src="js/api_page_generator.js"></script> |
17 <script type="text/javascript" src="js/bootstrap.js"></script> | 17 <script type="text/javascript" src="js/bootstrap.js"></script> |
18 <title>chrome.experimental.contextMenus - Google Chrome Extensions - Google Co
de</title></head><body> <div id="gc-container" class="labs"> | 18 <title>chrome.contextMenus - Google Chrome Extensions - Google Code</title></h
ead><body> <div id="gc-container" class="labs"> |
19 <div id="devModeWarning"> | 19 <div id="devModeWarning"> |
20 You are viewing extension docs in chrome via the 'file:' scheme: are you
expecting to see local changes when you refresh? You'll need run chrome with --
allow-file-access-from-files. | 20 You are viewing extension docs in chrome via the 'file:' scheme: are you
expecting to see local changes when you refresh? You'll need run chrome with --
allow-file-access-from-files. |
21 </div> | 21 </div> |
22 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | 22 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> |
23 <!-- In particular, sub-templates that recurse, must be used by allowing | 23 <!-- In particular, sub-templates that recurse, must be used by allowing |
24 jstemplate to make a copy of the template in this section which | 24 jstemplate to make a copy of the template in this section which |
25 are not operated on by way of the jsskip="true" --> | 25 are not operated on by way of the jsskip="true" --> |
26 <div style="display:none"> | 26 <div style="display:none"> |
27 | 27 |
28 <!-- VALUE --> | 28 <!-- VALUE --> |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 <!-- SIDENAV --> | 139 <!-- SIDENAV --> |
140 <div class="g-unit g-first" id="gc-toc"> | 140 <div class="g-unit g-first" id="gc-toc"> |
141 <ul> | 141 <ul> |
142 <li><a href="getstarted.html">Getting Started</a></li> | 142 <li><a href="getstarted.html">Getting Started</a></li> |
143 <li><a href="overview.html">Overview</a></li> | 143 <li><a href="overview.html">Overview</a></li> |
144 <li><h2><a href="devguide.html">Developer's Guide</a></h2> | 144 <li><h2><a href="devguide.html">Developer's Guide</a></h2> |
145 <ul> | 145 <ul> |
146 <li>Browser UI | 146 <li>Browser UI |
147 <ul> | 147 <ul> |
148 <li><a href="browserAction.html">Browser Actions</a></li> | 148 <li><a href="browserAction.html">Browser Actions</a></li> |
| 149 <li class="leftNavSelected">Context Menus</li> |
149 <li><a href="notifications.html">Desktop Notifications</a></li
> | 150 <li><a href="notifications.html">Desktop Notifications</a></li
> |
150 <li><a href="options.html">Options Pages</a></li> | 151 <li><a href="options.html">Options Pages</a></li> |
151 <li><a href="override.html">Override Pages</a></li> | 152 <li><a href="override.html">Override Pages</a></li> |
152 <li><a href="pageAction.html">Page Actions</a></li> | 153 <li><a href="pageAction.html">Page Actions</a></li> |
153 <li><a href="themes.html">Themes</a></li> | 154 <li><a href="themes.html">Themes</a></li> |
154 </ul> | 155 </ul> |
155 </li> | 156 </li> |
156 <li>Browser Interaction | 157 <li>Browser Interaction |
157 <ul> | 158 <ul> |
158 <li><a href="bookmarks.html">Bookmarks</a></li> | 159 <li><a href="bookmarks.html">Bookmarks</a></li> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 <li><a href="api_index.html">chrome.* APIs</a></li> | 203 <li><a href="api_index.html">chrome.* APIs</a></li> |
203 <li><a href="api_other.html">Other APIs</a></li> | 204 <li><a href="api_other.html">Other APIs</a></li> |
204 </ul> | 205 </ul> |
205 </li> | 206 </li> |
206 <li><h2><a href="samples.html">Samples</a></h2></li> | 207 <li><h2><a href="samples.html">Samples</a></h2></li> |
207 </ul> | 208 </ul> |
208 </div> | 209 </div> |
209 | 210 |
210 <div class="g-unit" id="gc-pagecontent"> | 211 <div class="g-unit" id="gc-pagecontent"> |
211 <div id="pageTitle"> | 212 <div id="pageTitle"> |
212 <h1 class="page_title">chrome.experimental.contextMenus</h1> | 213 <h1 class="page_title">chrome.contextMenus</h1> |
213 </div> | 214 </div> |
214 <!-- TABLE OF CONTENTS --> | 215 <!-- TABLE OF CONTENTS --> |
215 <div id="toc"> | 216 <div id="toc"> |
216 <h2>Contents</h2> | 217 <h2>Contents</h2> |
217 <ol> | 218 <ol> |
218 <li style="display: none; "> | 219 <li> |
219 <a>h2Name</a> | 220 <a href="#manifest">Manifest</a> |
220 <ol> | 221 <ol> |
221 <li> | 222 <li style="display: none; "> |
222 <a>h3Name</a> | 223 <a>h3Name</a> |
223 </li> | 224 </li> |
224 </ol> | 225 </ol> |
225 </li> | 226 </li> |
226 <li> | 227 <li> |
227 <a href="#apiReference">API reference: chrome.experimental.conte
xtMenus</a> | 228 <a href="#apiReference">API reference: chrome.contextMenus</a> |
228 <ol> | 229 <ol> |
229 <li style="display: none; "> | 230 <li style="display: none; "> |
230 <a href="#properties">Properties</a> | 231 <a href="#properties">Properties</a> |
231 <ol> | 232 <ol> |
232 <li> | 233 <li> |
233 <a href="#property-anchor">propertyName</a> | 234 <a href="#property-anchor">propertyName</a> |
234 </li> | 235 </li> |
235 </ol> | 236 </ol> |
236 </li> | 237 </li> |
237 <li> | 238 <li> |
(...skipping 27 matching lines...) Expand all Loading... |
265 </ol> | 266 </ol> |
266 </li> | 267 </li> |
267 </ol> | 268 </ol> |
268 </li> | 269 </li> |
269 </ol> | 270 </ol> |
270 </div> | 271 </div> |
271 <!-- /TABLE OF CONTENTS --> | 272 <!-- /TABLE OF CONTENTS --> |
272 | 273 |
273 <!-- STATIC CONTENT PLACEHOLDER --> | 274 <!-- STATIC CONTENT PLACEHOLDER --> |
274 <div id="static"><!-- BEGIN AUTHORED CONTENT --> | 275 <div id="static"><!-- BEGIN AUTHORED CONTENT --> |
275 <p id="classSummary"> | 276 <p> |
276 For information on how to use experimental APIs, | 277 The context menus module allows you |
277 see the <a href="experimental.html">chrome.experimental.* APIs</a> page. | 278 to add items to Chrome's context menu. |
278 </p> | 279 </p> |
279 | 280 |
| 281 <p> |
| 282 You can choose what types of objects |
| 283 your context menu additions apply to, |
| 284 such as images, hyperlinks, and pages. |
| 285 </p> |
| 286 |
| 287 <p> |
| 288 You can create as many context menu items |
| 289 as you need, but if more than one |
| 290 from your extension is visible at once, |
| 291 Google Chrome automatically collapses them |
| 292 into a single parent menu. |
| 293 </p> |
| 294 |
| 295 <h2 id="manifest">Manifest</h2> |
| 296 <p>You must declare the "contextMenus" permission |
| 297 in your extension's manifest to use the API. |
| 298 Also, you should specify a 16x16-pixel icon |
| 299 for display next to your menu item. |
| 300 For example: |
| 301 </p> |
| 302 |
| 303 <pre>{ |
| 304 "name": "My extension", |
| 305 ... |
| 306 "permissions": [ |
| 307 <b>"contextMenus"</b> |
| 308 ], |
| 309 "icons": { |
| 310 <b>"16": "icon-bitty.png",</b> |
| 311 "48": "icon-small.png", |
| 312 "128": "icon-large.png" |
| 313 }, |
| 314 ... |
| 315 }</pre> |
| 316 |
280 <!-- END AUTHORED CONTENT --> | 317 <!-- END AUTHORED CONTENT --> |
281 </div> | 318 </div> |
282 | 319 |
283 <!-- API PAGE --> | 320 <!-- API PAGE --> |
284 <div class="apiPage"> | 321 <div class="apiPage"> |
285 <a name="apiReference"></a> | 322 <a name="apiReference"></a> |
286 <h2>API reference: chrome.experimental.contextMenus</h2> | 323 <h2>API reference: chrome.contextMenus</h2> |
287 | 324 |
288 <!-- PROPERTIES --> | 325 <!-- PROPERTIES --> |
289 <div class="apiGroup" style="display: none; "> | 326 <div class="apiGroup" style="display: none; "> |
290 <a name="properties"></a> | 327 <a name="properties"></a> |
291 <h3 id="properties">Properties</h3> | 328 <h3 id="properties">Properties</h3> |
292 | 329 |
293 <div> | 330 <div> |
294 <a></a> | 331 <a></a> |
295 <h4>getLastError</h4> | 332 <h4>getLastError</h4> |
296 <div class="summary"> | 333 <div class="summary"> |
(...skipping 11 matching lines...) Expand all Loading... |
308 <a name="methods"></a> | 345 <a name="methods"></a> |
309 <h3>Methods</h3> | 346 <h3>Methods</h3> |
310 | 347 |
311 <!-- iterates over all functions --> | 348 <!-- iterates over all functions --> |
312 <div class="apiItem"> | 349 <div class="apiItem"> |
313 <a name="method-create"></a> <!-- method-anchor --> | 350 <a name="method-create"></a> <!-- method-anchor --> |
314 <h4>create</h4> | 351 <h4>create</h4> |
315 | 352 |
316 <div class="summary"><span>integer</span> | 353 <div class="summary"><span>integer</span> |
317 <!-- Note: intentionally longer 80 columns --> | 354 <!-- Note: intentionally longer 80 columns --> |
318 <span>chrome.experimental.contextMenus.create</span>(<span cla
ss="null"><span style="display: none; ">, </span><span>object</span> | 355 <span>chrome.contextMenus.create</span>(<span class="null"><sp
an style="display: none; ">, </span><span>object</span> |
319 <var><span>createProperties</span></var></span><span class
="optional"><span>, </span><span>function</span> | 356 <var><span>createProperties</span></var></span><span class
="optional"><span>, </span><span>function</span> |
320 <var><span>callback</span></var></span>)</div> | 357 <var><span>callback</span></var></span>)</div> |
321 | 358 |
322 <div class="description"> | 359 <div class="description"> |
323 <p class="todo" style="display: none; ">Undocumented.</p> | 360 <p class="todo" style="display: none; ">Undocumented.</p> |
324 <p>Creates a new context menu item. Note that if an error occurs
during creation, you may not find out until the creation callback fires (the de
tails will be in chrome.extension.lastError).</p> | 361 <p>Creates a new context menu item. Note that if an error occurs
during creation, you may not find out until the creation callback fires (the de
tails will be in chrome.extension.lastError).</p> |
325 | 362 |
326 <!-- PARAMETERS --> | 363 <!-- PARAMETERS --> |
327 <h4>Parameters</h4> | 364 <h4>Parameters</h4> |
328 <dl> | 365 <dl> |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 can ensure that your extension won't be run in an earlier brow
ser version. | 882 can ensure that your extension won't be run in an earlier brow
ser version. |
846 </p> | 883 </p> |
847 </div> <!-- /description --> | 884 </div> <!-- /description --> |
848 | 885 |
849 </div><div class="apiItem"> | 886 </div><div class="apiItem"> |
850 <a name="method-remove"></a> <!-- method-anchor --> | 887 <a name="method-remove"></a> <!-- method-anchor --> |
851 <h4>remove</h4> | 888 <h4>remove</h4> |
852 | 889 |
853 <div class="summary"><span style="display: none; ">void</span> | 890 <div class="summary"><span style="display: none; ">void</span> |
854 <!-- Note: intentionally longer 80 columns --> | 891 <!-- Note: intentionally longer 80 columns --> |
855 <span>chrome.experimental.contextMenus.remove</span>(<span cla
ss="null"><span style="display: none; ">, </span><span>integer</span> | 892 <span>chrome.contextMenus.remove</span>(<span class="null"><sp
an style="display: none; ">, </span><span>integer</span> |
856 <var><span>menuItemId</span></var></span><span class="opti
onal"><span>, </span><span>function</span> | 893 <var><span>menuItemId</span></var></span><span class="opti
onal"><span>, </span><span>function</span> |
857 <var><span>callback</span></var></span>)</div> | 894 <var><span>callback</span></var></span>)</div> |
858 | 895 |
859 <div class="description"> | 896 <div class="description"> |
860 <p class="todo" style="display: none; ">Undocumented.</p> | 897 <p class="todo" style="display: none; ">Undocumented.</p> |
861 <p>Remove a context menu item.</p> | 898 <p>Remove a context menu item.</p> |
862 | 899 |
863 <!-- PARAMETERS --> | 900 <!-- PARAMETERS --> |
864 <h4>Parameters</h4> | 901 <h4>Parameters</h4> |
865 <dl> | 902 <dl> |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 can ensure that your extension won't be run in an earlier brow
ser version. | 1048 can ensure that your extension won't be run in an earlier brow
ser version. |
1012 </p> | 1049 </p> |
1013 </div> <!-- /description --> | 1050 </div> <!-- /description --> |
1014 | 1051 |
1015 </div><div class="apiItem"> | 1052 </div><div class="apiItem"> |
1016 <a name="method-removeAll"></a> <!-- method-anchor --> | 1053 <a name="method-removeAll"></a> <!-- method-anchor --> |
1017 <h4>removeAll</h4> | 1054 <h4>removeAll</h4> |
1018 | 1055 |
1019 <div class="summary"><span style="display: none; ">void</span> | 1056 <div class="summary"><span style="display: none; ">void</span> |
1020 <!-- Note: intentionally longer 80 columns --> | 1057 <!-- Note: intentionally longer 80 columns --> |
1021 <span>chrome.experimental.contextMenus.removeAll</span>(<span
class="optional"><span style="display: none; ">, </span><span>function</span> | 1058 <span>chrome.contextMenus.removeAll</span>(<span class="option
al"><span style="display: none; ">, </span><span>function</span> |
1022 <var><span>callback</span></var></span>)</div> | 1059 <var><span>callback</span></var></span>)</div> |
1023 | 1060 |
1024 <div class="description"> | 1061 <div class="description"> |
1025 <p class="todo" style="display: none; ">Undocumented.</p> | 1062 <p class="todo" style="display: none; ">Undocumented.</p> |
1026 <p>Remove all context menu items added by this extension.</p> | 1063 <p>Remove all context menu items added by this extension.</p> |
1027 | 1064 |
1028 <!-- PARAMETERS --> | 1065 <!-- PARAMETERS --> |
1029 <h4>Parameters</h4> | 1066 <h4>Parameters</h4> |
1030 <dl> | 1067 <dl> |
1031 <div> | 1068 <div> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 can ensure that your extension won't be run in an earlier brow
ser version. | 1161 can ensure that your extension won't be run in an earlier brow
ser version. |
1125 </p> | 1162 </p> |
1126 </div> <!-- /description --> | 1163 </div> <!-- /description --> |
1127 | 1164 |
1128 </div><div class="apiItem"> | 1165 </div><div class="apiItem"> |
1129 <a name="method-update"></a> <!-- method-anchor --> | 1166 <a name="method-update"></a> <!-- method-anchor --> |
1130 <h4>update</h4> | 1167 <h4>update</h4> |
1131 | 1168 |
1132 <div class="summary"><span style="display: none; ">void</span> | 1169 <div class="summary"><span style="display: none; ">void</span> |
1133 <!-- Note: intentionally longer 80 columns --> | 1170 <!-- Note: intentionally longer 80 columns --> |
1134 <span>chrome.experimental.contextMenus.update</span>(<span cla
ss="null"><span style="display: none; ">, </span><span>integer</span> | 1171 <span>chrome.contextMenus.update</span>(<span class="null"><sp
an style="display: none; ">, </span><span>integer</span> |
1135 <var><span>id</span></var></span><span class="null"><span>
, </span><span>object</span> | 1172 <var><span>id</span></var></span><span class="null"><span>
, </span><span>object</span> |
1136 <var><span>updateProperties</span></var></span><span class
="optional"><span>, </span><span>function</span> | 1173 <var><span>updateProperties</span></var></span><span class
="optional"><span>, </span><span>function</span> |
1137 <var><span>callback</span></var></span>)</div> | 1174 <var><span>callback</span></var></span>)</div> |
1138 | 1175 |
1139 <div class="description"> | 1176 <div class="description"> |
1140 <p class="todo" style="display: none; ">Undocumented.</p> | 1177 <p class="todo" style="display: none; ">Undocumented.</p> |
1141 <p>Update a previously created context menu item.</p> | 1178 <p>Update a previously created context menu item.</p> |
1142 | 1179 |
1143 <!-- PARAMETERS --> | 1180 <!-- PARAMETERS --> |
1144 <h4>Parameters</h4> | 1181 <h4>Parameters</h4> |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 _uff=0; | 1802 _uff=0; |
1766 urchinTracker(); | 1803 urchinTracker(); |
1767 } | 1804 } |
1768 catch(e) {/* urchinTracker not available. */} | 1805 catch(e) {/* urchinTracker not available. */} |
1769 </script> | 1806 </script> |
1770 <!-- end analytics --> | 1807 <!-- end analytics --> |
1771 </div> | 1808 </div> |
1772 </div> <!-- /gc-footer --> | 1809 </div> <!-- /gc-footer --> |
1773 </div> <!-- /gc-container --> | 1810 </div> <!-- /gc-container --> |
1774 </body></html> | 1811 </body></html> |
OLD | NEW |