OLD | NEW |
| (Empty) |
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 | |
3 across api docs and should be edited only with knowledge of the | |
4 templating mechanism. | |
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 | |
7 authored overview content. | |
8 4) The <body>.innerHTML is also generated by an offline step so that this | |
9 page may easily be indexed by search engines. | |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | |
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | |
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"> | |
15 </script> | |
16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | |
17 </script> | |
18 <script type="text/javascript" src="js/api_page_generator.js"></script> | |
19 <script type="text/javascript" src="js/bootstrap.js"></script> | |
20 <script type="text/javascript" src="js/sidebar.js"></script> | |
21 <meta name="description" content="Documentation for the chrome.contextMenus mo
dule, which is part of the Google Chrome extension APIs."><title>Context Menus
- Google Chrome Extensions - Google Code</title></head> | |
22 <body> <div id="devModeWarning" class="displayModeWarning"> | |
23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. | |
24 </div> | |
25 <div id="branchWarning" class="displayModeWarning"> | |
26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | |
27 It may not work with the stable release of Chrome.</span> | |
28 <select id="branchChooser"> | |
29 <option>Choose a different version... | |
30 </option><option value="">Stable | |
31 </option><option value="beta">Beta | |
32 </option><option value="dev">Dev | |
33 </option><option value="trunk">Trunk | |
34 </option></select> | |
35 </div> | |
36 <div id="unofficialWarning" class="displayModeWarning"> | |
37 <span>WARNING: This is unofficial documentation. It may not work with the | |
38 current release of Chrome.</span> | |
39 <button id="goToOfficialDocs">Go to the official docs</button> | |
40 </div> | |
41 <div id="gc-container" class="labs"> | |
42 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | |
43 <!-- In particular, sub-templates that recurse, must be used by allowing | |
44 jstemplate to make a copy of the template in this section which | |
45 are not operated on by way of the jsskip="true" --> | |
46 <!-- /SUBTEMPLATES --> | |
47 <a id="top"></a> | |
48 <div id="skipto"> | |
49 <a href="#gc-pagecontent">Skip to page content</a> | |
50 <a href="#gc-toc">Skip to main navigation</a> | |
51 </div> | |
52 <!-- API HEADER --> | |
53 <table id="header" width="100%" cellspacing="0" border="0"> | |
54 <tbody><tr> | |
55 <td valign="middle"><a href="http://code.google.com/"><img src="images/c
ode_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:
0; margin:0;"></a></td> | |
56 <td valign="middle" width="100%" style="padding-left:0.6em;"> | |
57 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.
5em"> | |
58 <div id="gsc-search-box"> | |
59 <input type="hidden" name="cx" value="002967670403910741006:61_cvz
fqtno"> | |
60 <input type="hidden" name="ie" value="UTF-8"> | |
61 <input type="text" name="q" value="" size="55"> | |
62 <input class="gsc-search-button" type="submit" name="sa" value="Se
arch"> | |
63 <br> | |
64 <span class="greytext">e.g. "page action" or "tabs"</span> | |
65 </div> | |
66 </form> | |
67 <script type="text/javascript" src="https://www.google.com/jsapi"></sc
ript> | |
68 <script type="text/javascript">google.load("elements", "1", {packages:
"transliteration"});</script> | |
69 <script type="text/javascript" src="https://www.google.com/coop/cse/t1
3n?form=cse&t13n_langs=en"></script> | |
70 <script type="text/javascript" src="https://www.google.com/coop/cse/br
and?form=cse&lang=en"></script> | |
71 </td> | |
72 </tr> | |
73 </tbody></table> | |
74 <div id="codesiteContent" class=""> | |
75 <a id="gc-topnav-anchor"></a> | |
76 <div id="gc-topnav"> | |
77 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab
s</a>)</h1> | |
78 <ul id="home" class="gc-topnav-tabs"> | |
79 <li id="home_link"> | |
80 <a href="index.html" title="Google Chrome Extensions home page">Home
</a> | |
81 </li> | |
82 <li id="docs_link"> | |
83 <a href="docs.html" title="Official Google Chrome Extensions documen
tation">Docs</a> | |
84 </li> | |
85 <li id="faq_link"> | |
86 <a href="faq.html" title="Answers to frequently asked questions abou
t Google Chrome Extensions">FAQ</a> | |
87 </li> | |
88 <li id="samples_link"> | |
89 <a href="samples.html" title="Sample extensions (with source code)">
Samples</a> | |
90 </li> | |
91 <li id="group_link"> | |
92 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte
nsions" title="Google Chrome Extensions developer forum">Group</a> | |
93 </li> | |
94 <li id="so_link"> | |
95 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext
ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a> | |
96 </li> | |
97 </ul> | |
98 </div> <!-- end gc-topnav --> | |
99 <div class="g-section g-tpl-170"> | |
100 <!-- SIDENAV --> | |
101 <div class="g-unit g-first" id="gc-toc"> | |
102 <ul> | |
103 <li><a href="getstarted.html">Getting Started</a></li> | |
104 <li><a href="overview.html">Overview</a></li> | |
105 <li><a href="whats_new.html">What's New?</a></li> | |
106 <li><h2><a href="devguide.html">Developer's Guide</a></h2> | |
107 <ul> | |
108 <li>Browser UI | |
109 <ul> | |
110 <li><a href="browserAction.html">Browser Actions</a></li> | |
111 <li class="leftNavSelected">Context Menus</li> | |
112 <li><a href="notifications.html">Desktop Notifications</a></li
> | |
113 <li><a href="omnibox.html">Omnibox</a></li> | |
114 <li><a href="options.html">Options Pages</a></li> | |
115 <li><a href="override.html">Override Pages</a></li> | |
116 <li><a href="pageAction.html">Page Actions</a></li> | |
117 </ul> | |
118 </li> | |
119 <li>Browser Interaction | |
120 <ul> | |
121 <li><a href="bookmarks.html">Bookmarks</a></li> | |
122 <li><a href="cookies.html">Cookies</a></li> | |
123 <li><a href="devtools.html">Developer Tools</a></li> | |
124 <li><a href="events.html">Events</a></li> | |
125 <li><a href="history.html">History</a></li> | |
126 <li><a href="management.html">Management</a></li> | |
127 <li><a href="tabs.html">Tabs</a></li> | |
128 <li><a href="windows.html">Windows</a></li> | |
129 </ul> | |
130 </li> | |
131 <li>Implementation | |
132 <ul> | |
133 <li><a href="a11y.html">Accessibility</a></li> | |
134 <li><a href="background_pages.html">Background Pages</a></li> | |
135 <li><a href="content_scripts.html">Content Scripts</a></li> | |
136 <li><a href="xhr.html">Cross-Origin XHR</a></li> | |
137 <li><a href="i18n.html">Internationalization</a></li> | |
138 <li><a href="messaging.html">Message Passing</a></li> | |
139 <li><a href="permissions.html">Optional Permissions</a></li> | |
140 <li><a href="npapi.html">NPAPI Plugins</a></li> | |
141 </ul> | |
142 </li> | |
143 <li>Finishing | |
144 <ul> | |
145 <li><a href="hosting.html">Hosting</a></li> | |
146 <li><a href="external_extensions.html">Other Deployment Option
s</a></li> | |
147 </ul> | |
148 </li> | |
149 </ul> | |
150 </li> | |
151 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> | |
152 <li><h2><a href="tutorials.html">Tutorials</a></h2> | |
153 <ul> | |
154 <li><a href="tut_debugging.html">Debugging</a></li> | |
155 <li><a href="tut_analytics.html">Google Analytics</a></li> | |
156 <li><a href="tut_oauth.html">OAuth</a></li> | |
157 </ul> | |
158 </li> | |
159 <li><h2>Reference</h2> | |
160 <ul> | |
161 <li>Formats | |
162 <ul> | |
163 <li><a href="manifest.html">Manifest Files</a></li> | |
164 <li><a href="match_patterns.html">Match Patterns</a></li> | |
165 </ul> | |
166 </li> | |
167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> | |
168 <li><a href="api_index.html">chrome.* APIs</a></li> | |
169 <li><a href="api_other.html">Other APIs</a></li> | |
170 </ul> | |
171 </li> | |
172 <li><h2><a href="samples.html">Samples</a></h2></li> | |
173 <div class="line"> </div> | |
174 <li><h2>More</h2> | |
175 <ul> | |
176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm
l">Chrome Web Store</a></li> | |
177 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu
ide.html">Hosted Apps</a></li> | |
178 <li><a href="themes.html">Themes</a></li> | |
179 </ul> | |
180 </li> | |
181 </ul> | |
182 </div> | |
183 <script> | |
184 initToggles(); | |
185 </script> | |
186 <div class="g-unit" id="gc-pagecontent"> | |
187 <div id="pageTitle"> | |
188 <h1 class="page_title">Context Menus</h1> | |
189 </div> | |
190 <!-- TABLE OF CONTENTS --> | |
191 <div id="toc"> | |
192 <h2>Contents</h2> | |
193 <ol> | |
194 <li> | |
195 <a href="#manifest">Manifest</a> | |
196 <ol> | |
197 </ol> | |
198 </li><li> | |
199 <a href="#examples">Examples</a> | |
200 <ol> | |
201 </ol> | |
202 </li> | |
203 <li> | |
204 <a href="#apiReference">API reference: chrome.contextMenus</a> | |
205 <ol> | |
206 <li> | |
207 <a href="#global-methods">Methods</a> | |
208 <ol> | |
209 <li> | |
210 <a href="#method-create">create</a> | |
211 </li><li> | |
212 <a href="#method-remove">remove</a> | |
213 </li><li> | |
214 <a href="#method-removeAll">removeAll</a> | |
215 </li><li> | |
216 <a href="#method-update">update</a> | |
217 </li> | |
218 </ol> | |
219 </li> | |
220 <li> | |
221 <a href="#global-events">Events</a> | |
222 <ol> | |
223 <li> | |
224 <a href="#event-onClicked">onClicked</a> | |
225 </li> | |
226 </ol> | |
227 </li> | |
228 <li> | |
229 <a href="#types">Types</a> | |
230 <ol> | |
231 <li> | |
232 <a href="#type-OnClickData">OnClickData</a> | |
233 <ol> | |
234 </ol> | |
235 </li> | |
236 </ol> | |
237 </li> | |
238 </ol> | |
239 </li> | |
240 </ol> | |
241 </div> | |
242 <!-- /TABLE OF CONTENTS --> | |
243 <!-- Standard content lead-in for experimental API pages --> | |
244 <!-- STATIC CONTENT PLACEHOLDER --> | |
245 <div id="static"><div id="pageData-name" class="pageData">Context Menus<
/div> | |
246 <!-- BEGIN AUTHORED CONTENT --> | |
247 <p> | |
248 The context menus module allows you | |
249 to add items to Google Chrome's context menu. | |
250 </p> | |
251 <p> | |
252 You can choose what types of objects | |
253 your context menu additions apply to, | |
254 such as images, hyperlinks, and pages. | |
255 </p> | |
256 <p> | |
257 You can create as many context menu items | |
258 as you need, but if more than one | |
259 from your extension is visible at once, | |
260 Google Chrome automatically collapses them | |
261 into a single parent menu. | |
262 </p> | |
263 <p> | |
264 Context menu items can appear in any document | |
265 (or frame within a document), | |
266 even those with file:// or chrome:// URLs. | |
267 To control which documents your items can appear in, | |
268 specify the documentUrlPatterns field | |
269 when you call the create() or update() method. | |
270 </p> | |
271 <p class="note"> | |
272 <strong>Version note:</strong> | |
273 Before Chrome 14, <!-- PENDING(asargent): fix version # --> | |
274 your items could appear only in documents with http:// | |
275 or https:// URLs. | |
276 </p> | |
277 <h2 id="manifest">Manifest</h2> | |
278 <p>You must declare the "contextMenus" permission | |
279 in your extension's manifest to use the API. | |
280 Also, you should specify a 16x16-pixel icon | |
281 for display next to your menu item. | |
282 For example: | |
283 </p> | |
284 <pre>{ | |
285 "name": "My extension", | |
286 ... | |
287 "permissions": [ | |
288 <b>"contextMenus"</b> | |
289 ], | |
290 "icons": { | |
291 <b>"16": "icon-bitty.png",</b> | |
292 "48": "icon-small.png", | |
293 "128": "icon-large.png" | |
294 }, | |
295 ... | |
296 }</pre> | |
297 <h2 id="examples">Examples</h2> | |
298 <p> | |
299 You can find samples of this API on the | |
300 <a href="samples.html#contextMenus">sample page</a>. | |
301 <!-- END AUTHORED CONTENT --> | |
302 </p></div> | |
303 <!-- API PAGE --> | |
304 <div class="apiPage"> | |
305 <a name="apiReference"></a> | |
306 <h2>API reference: chrome.contextMenus</h2> | |
307 <!-- PROPERTIES --> | |
308 <!-- /apiGroup --> | |
309 <!-- METHODS --> | |
310 <div id="methodsTemplate" class="apiGroup"> | |
311 <a name="global-methods"></a> | |
312 <h3>Methods</h3> | |
313 <!-- iterates over all functions --> | |
314 <div class="apiItem"> | |
315 <a name="method-create"></a> <!-- method-anchor --> | |
316 <h4>create</h4> | |
317 <div class="summary"><span>integer or string</span> | |
318 <!-- Note: intentionally longer 80 columns --> | |
319 <span>chrome.contextMenus.create</span>(<span class="null"><sp
an>object</span> | |
320 <var><span>createProperties</span></var></span><span class
="optional"><span>, </span><span>function</span> | |
321 <var><span>callback</span></var></span>)</div> | |
322 <div class="description"> | |
323 <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> | |
324 <!-- PARAMETERS --> | |
325 <h4>Parameters</h4> | |
326 <dl> | |
327 <div> | |
328 <div> | |
329 <dt> | |
330 <var>createProperties</var> | |
331 <em> | |
332 <!-- TYPE --> | |
333 <div style="display:inline"> | |
334 ( | |
335 <span id="typeTemplate"> | |
336 <span> | |
337 <span>object</span> | |
338 </span> | |
339 </span> | |
340 ) | |
341 </div> | |
342 </em> | |
343 </dt> | |
344 <dd class="todo"> | |
345 Undocumented. | |
346 </dd> | |
347 <!-- OBJECT PROPERTIES --> | |
348 <dd> | |
349 <dl> | |
350 <div> | |
351 <div> | |
352 <dt> | |
353 <var>type</var> | |
354 <em> | |
355 <!-- TYPE --> | |
356 <div style="display:inline"> | |
357 ( | |
358 <span class="optional">optional</span> | |
359 <span class="enum">enumerated</span> | |
360 <span id="typeTemplate"> | |
361 <span> | |
362 <span>string</span> | |
363 <span>["normal", "checkbox", "radio", "separator"]</span
> | |
364 </span> | |
365 </span> | |
366 ) | |
367 </div> | |
368 </em> | |
369 </dt> | |
370 <dd>The type of menu item. Defaults to 'normal' if not specified.</dd> | |
371 <!-- OBJECT PROPERTIES --> | |
372 <!-- OBJECT METHODS --> | |
373 <!-- OBJECT EVENT FIELDS --> | |
374 <!-- FUNCTION PARAMETERS --> | |
375 </div> | |
376 </div><div> | |
377 <div> | |
378 <dt> | |
379 <var>id</var> | |
380 <em> | |
381 <!-- TYPE --> | |
382 <div style="display:inline"> | |
383 ( | |
384 <span class="optional">optional</span> | |
385 <span id="typeTemplate"> | |
386 <span> | |
387 <span>string</span> | |
388 </span> | |
389 </span> | |
390 ) | |
391 </div> | |
392 </em> | |
393 </dt> | |
394 <dd>The unique ID to assign to this item. Mandatory for event pages. C
annot be the same as another ID for this extension.</dd> | |
395 <!-- OBJECT PROPERTIES --> | |
396 <!-- OBJECT METHODS --> | |
397 <!-- OBJECT EVENT FIELDS --> | |
398 <!-- FUNCTION PARAMETERS --> | |
399 </div> | |
400 </div><div> | |
401 <div> | |
402 <dt> | |
403 <var>title</var> | |
404 <em> | |
405 <!-- TYPE --> | |
406 <div style="display:inline"> | |
407 ( | |
408 <span class="optional">optional</span> | |
409 <span id="typeTemplate"> | |
410 <span> | |
411 <span>string</span> | |
412 </span> | |
413 </span> | |
414 ) | |
415 </div> | |
416 </em> | |
417 </dt> | |
418 <dd>The text to be displayed in the item; this is <em>required</em> un
less <em>type</em> is 'separator'. When the context is 'selection', you can use
<code>%s</code> within the string to show the selected text. For example, if thi
s parameter's value is "Translate '%s' to Pig Latin" and the user selects the wo
rd "cool", the context menu item for the selection is "Translate 'cool' to Pig L
atin".</dd> | |
419 <!-- OBJECT PROPERTIES --> | |
420 <!-- OBJECT METHODS --> | |
421 <!-- OBJECT EVENT FIELDS --> | |
422 <!-- FUNCTION PARAMETERS --> | |
423 </div> | |
424 </div><div> | |
425 <div> | |
426 <dt> | |
427 <var>checked</var> | |
428 <em> | |
429 <!-- TYPE --> | |
430 <div style="display:inline"> | |
431 ( | |
432 <span class="optional">optional</span> | |
433 <span id="typeTemplate"> | |
434 <span> | |
435 <span>boolean</span> | |
436 </span> | |
437 </span> | |
438 ) | |
439 </div> | |
440 </em> | |
441 </dt> | |
442 <dd>The initial state of a checkbox or radio item: true for selected a
nd false for unselected. Only one radio item can be selected at a time in a give
n group of radio items.</dd> | |
443 <!-- OBJECT PROPERTIES --> | |
444 <!-- OBJECT METHODS --> | |
445 <!-- OBJECT EVENT FIELDS --> | |
446 <!-- FUNCTION PARAMETERS --> | |
447 </div> | |
448 </div><div> | |
449 <div> | |
450 <dt> | |
451 <var>contexts</var> | |
452 <em> | |
453 <!-- TYPE --> | |
454 <div style="display:inline"> | |
455 ( | |
456 <span class="optional">optional</span> | |
457 <span id="typeTemplate"> | |
458 <span> | |
459 <span> | |
460 array of <span><span> | |
461 <span> | |
462 <span>string</span> | |
463 <span>["all", "page", "frame", "selection", "link", "edi
table", "image", "video", "audio"]</span> | |
464 </span> | |
465 </span></span> | |
466 </span> | |
467 </span> | |
468 </span> | |
469 ) | |
470 </div> | |
471 </em> | |
472 </dt> | |
473 <dd>List of contexts this menu item will appear in. Defaults to ['page
'] if not specified.</dd> | |
474 <!-- OBJECT PROPERTIES --> | |
475 <!-- OBJECT METHODS --> | |
476 <!-- OBJECT EVENT FIELDS --> | |
477 <!-- FUNCTION PARAMETERS --> | |
478 </div> | |
479 </div><div> | |
480 <div> | |
481 <dt> | |
482 <var>onclick</var> | |
483 <em> | |
484 <!-- TYPE --> | |
485 <div style="display:inline"> | |
486 ( | |
487 <span class="optional">optional</span> | |
488 <span id="typeTemplate"> | |
489 <span> | |
490 <span>function</span> | |
491 </span> | |
492 </span> | |
493 ) | |
494 </div> | |
495 </em> | |
496 </dt> | |
497 <dd>A function that will be called back when the menu item is clicked.
Event pages cannot use this; instead, they should register a listener for chrom
e.contextMenus.onClicked.</dd> | |
498 <!-- OBJECT PROPERTIES --> | |
499 <!-- OBJECT METHODS --> | |
500 <!-- OBJECT EVENT FIELDS --> | |
501 <!-- FUNCTION PARAMETERS --> | |
502 <dd> | |
503 <div> | |
504 <h5>Parameters</h5> | |
505 <dl> | |
506 <div> | |
507 <div> | |
508 <dt> | |
509 <var>info</var> | |
510 <em> | |
511 <!-- TYPE --> | |
512 <div style="display:inline"> | |
513 ( | |
514 <span id="typeTemplate"> | |
515 <span> | |
516 <a href="contextMenus.html#type-OnClickData">OnClickData
</a> | |
517 </span> | |
518 </span> | |
519 ) | |
520 </div> | |
521 </em> | |
522 </dt> | |
523 <dd>Information about the item clicked and the context where the click
happened.</dd> | |
524 <!-- OBJECT PROPERTIES --> | |
525 <!-- OBJECT METHODS --> | |
526 <!-- OBJECT EVENT FIELDS --> | |
527 <!-- FUNCTION PARAMETERS --> | |
528 </div> | |
529 </div><div> | |
530 <div> | |
531 <dt> | |
532 <var>tab</var> | |
533 <em> | |
534 <!-- TYPE --> | |
535 <div style="display:inline"> | |
536 ( | |
537 <span id="typeTemplate"> | |
538 <span> | |
539 <a>tabs.Tab</a> | |
540 </span> | |
541 </span> | |
542 ) | |
543 </div> | |
544 </em> | |
545 </dt> | |
546 <dd>The details of the tab where the click took place.</dd> | |
547 <!-- OBJECT PROPERTIES --> | |
548 <!-- OBJECT METHODS --> | |
549 <!-- OBJECT EVENT FIELDS --> | |
550 <!-- FUNCTION PARAMETERS --> | |
551 </div> | |
552 </div> | |
553 </dl> | |
554 </div> | |
555 </dd> | |
556 </div> | |
557 </div><div> | |
558 <div> | |
559 <dt> | |
560 <var>parentId</var> | |
561 <em> | |
562 <!-- TYPE --> | |
563 <div style="display:inline"> | |
564 ( | |
565 <span class="optional">optional</span> | |
566 <span id="typeTemplate"> | |
567 <span> | |
568 <span>integer or string</span> | |
569 </span> | |
570 </span> | |
571 ) | |
572 </div> | |
573 </em> | |
574 </dt> | |
575 <dd>The ID of a parent menu item; this makes the item a child of a pre
viously added item.</dd> | |
576 <!-- OBJECT PROPERTIES --> | |
577 <!-- OBJECT METHODS --> | |
578 <!-- OBJECT EVENT FIELDS --> | |
579 <!-- FUNCTION PARAMETERS --> | |
580 </div> | |
581 </div><div> | |
582 <div> | |
583 <dt> | |
584 <var>documentUrlPatterns</var> | |
585 <em> | |
586 <!-- TYPE --> | |
587 <div style="display:inline"> | |
588 ( | |
589 <span class="optional">optional</span> | |
590 <span id="typeTemplate"> | |
591 <span> | |
592 <span> | |
593 array of <span><span> | |
594 <span> | |
595 <span>string</span> | |
596 </span> | |
597 </span></span> | |
598 </span> | |
599 </span> | |
600 </span> | |
601 ) | |
602 </div> | |
603 </em> | |
604 </dt> | |
605 <dd>Lets you restrict the item to apply only to documents whose URL ma
tches one of the given patterns. (This applies to frames as well.) For details o
n the format of a pattern, see <a href="match_patterns.html">Match Patterns</a>.
</dd> | |
606 <!-- OBJECT PROPERTIES --> | |
607 <!-- OBJECT METHODS --> | |
608 <!-- OBJECT EVENT FIELDS --> | |
609 <!-- FUNCTION PARAMETERS --> | |
610 </div> | |
611 </div><div> | |
612 <div> | |
613 <dt> | |
614 <var>targetUrlPatterns</var> | |
615 <em> | |
616 <!-- TYPE --> | |
617 <div style="display:inline"> | |
618 ( | |
619 <span class="optional">optional</span> | |
620 <span id="typeTemplate"> | |
621 <span> | |
622 <span> | |
623 array of <span><span> | |
624 <span> | |
625 <span>string</span> | |
626 </span> | |
627 </span></span> | |
628 </span> | |
629 </span> | |
630 </span> | |
631 ) | |
632 </div> | |
633 </em> | |
634 </dt> | |
635 <dd>Similar to documentUrlPatterns, but lets you filter based on the s
rc attribute of img/audio/video tags and the href of anchor tags.</dd> | |
636 <!-- OBJECT PROPERTIES --> | |
637 <!-- OBJECT METHODS --> | |
638 <!-- OBJECT EVENT FIELDS --> | |
639 <!-- FUNCTION PARAMETERS --> | |
640 </div> | |
641 </div><div> | |
642 <div> | |
643 <dt> | |
644 <var>enabled</var> | |
645 <em> | |
646 <!-- TYPE --> | |
647 <div style="display:inline"> | |
648 ( | |
649 <span class="optional">optional</span> | |
650 <span id="typeTemplate"> | |
651 <span> | |
652 <span>boolean</span> | |
653 </span> | |
654 </span> | |
655 ) | |
656 </div> | |
657 </em> | |
658 </dt> | |
659 <dd>Whether this context menu item is enabled or disabled. Defaults to
true.</dd> | |
660 <!-- OBJECT PROPERTIES --> | |
661 <!-- OBJECT METHODS --> | |
662 <!-- OBJECT EVENT FIELDS --> | |
663 <!-- FUNCTION PARAMETERS --> | |
664 </div> | |
665 </div> | |
666 </dl> | |
667 </dd> | |
668 <!-- OBJECT METHODS --> | |
669 <!-- OBJECT EVENT FIELDS --> | |
670 <!-- FUNCTION PARAMETERS --> | |
671 </div> | |
672 </div><div> | |
673 <div> | |
674 <dt> | |
675 <var>callback</var> | |
676 <em> | |
677 <!-- TYPE --> | |
678 <div style="display:inline"> | |
679 ( | |
680 <span class="optional">optional</span> | |
681 <span id="typeTemplate"> | |
682 <span> | |
683 <span>function</span> | |
684 </span> | |
685 </span> | |
686 ) | |
687 </div> | |
688 </em> | |
689 </dt> | |
690 <dd>Called when the item has been created in the browser. If there wer
e any problems creating the item, details will be available in chrome.extension.
lastError.</dd> | |
691 <!-- OBJECT PROPERTIES --> | |
692 <!-- OBJECT METHODS --> | |
693 <!-- OBJECT EVENT FIELDS --> | |
694 <!-- FUNCTION PARAMETERS --> | |
695 </div> | |
696 </div> | |
697 </dl> | |
698 <!-- RETURNS --> | |
699 <h4>Returns</h4> | |
700 <dl> | |
701 <div> | |
702 <div> | |
703 <dt> | |
704 <em> | |
705 <!-- TYPE --> | |
706 <div style="display:inline"> | |
707 ( | |
708 <span id="typeTemplate"> | |
709 <span> | |
710 <span>integer or string</span> | |
711 </span> | |
712 </span> | |
713 ) | |
714 </div> | |
715 </em> | |
716 </dt> | |
717 <dd>The ID of the newly created item.</dd> | |
718 <!-- OBJECT PROPERTIES --> | |
719 <!-- OBJECT METHODS --> | |
720 <!-- OBJECT EVENT FIELDS --> | |
721 <!-- FUNCTION PARAMETERS --> | |
722 </div> | |
723 </div> | |
724 </dl> | |
725 <!-- CALLBACK --> | |
726 <div> | |
727 <div> | |
728 <h4>Callback function</h4> | |
729 <p> | |
730 If you specify the <em>callback</em> parameter, it should | |
731 specify a function that looks like this: | |
732 </p> | |
733 <!-- Note: intentionally longer 80 columns --> | |
734 <pre>function(<span></span>) <span class="subdued">{...}</span
>;</pre> | |
735 <dl> | |
736 </dl> | |
737 </div> | |
738 </div> | |
739 <!-- MIN_VERSION --> | |
740 </div> <!-- /description --> | |
741 </div><div class="apiItem"> | |
742 <a name="method-remove"></a> <!-- method-anchor --> | |
743 <h4>remove</h4> | |
744 <div class="summary"> | |
745 <!-- Note: intentionally longer 80 columns --> | |
746 <span>chrome.contextMenus.remove</span>(<span class="null"><sp
an>integer or string</span> | |
747 <var><span>menuItemId</span></var></span><span class="opti
onal"><span>, </span><span>function</span> | |
748 <var><span>callback</span></var></span>)</div> | |
749 <div class="description"> | |
750 <p>Removes a context menu item.</p> | |
751 <!-- PARAMETERS --> | |
752 <h4>Parameters</h4> | |
753 <dl> | |
754 <div> | |
755 <div> | |
756 <dt> | |
757 <var>menuItemId</var> | |
758 <em> | |
759 <!-- TYPE --> | |
760 <div style="display:inline"> | |
761 ( | |
762 <span id="typeTemplate"> | |
763 <span> | |
764 <span>integer or string</span> | |
765 </span> | |
766 </span> | |
767 ) | |
768 </div> | |
769 </em> | |
770 </dt> | |
771 <dd>The ID of the context menu item to remove.</dd> | |
772 <!-- OBJECT PROPERTIES --> | |
773 <!-- OBJECT METHODS --> | |
774 <!-- OBJECT EVENT FIELDS --> | |
775 <!-- FUNCTION PARAMETERS --> | |
776 </div> | |
777 </div><div> | |
778 <div> | |
779 <dt> | |
780 <var>callback</var> | |
781 <em> | |
782 <!-- TYPE --> | |
783 <div style="display:inline"> | |
784 ( | |
785 <span class="optional">optional</span> | |
786 <span id="typeTemplate"> | |
787 <span> | |
788 <span>function</span> | |
789 </span> | |
790 </span> | |
791 ) | |
792 </div> | |
793 </em> | |
794 </dt> | |
795 <dd>Called when the context menu has been removed.</dd> | |
796 <!-- OBJECT PROPERTIES --> | |
797 <!-- OBJECT METHODS --> | |
798 <!-- OBJECT EVENT FIELDS --> | |
799 <!-- FUNCTION PARAMETERS --> | |
800 </div> | |
801 </div> | |
802 </dl> | |
803 <!-- RETURNS --> | |
804 <dl> | |
805 </dl> | |
806 <!-- CALLBACK --> | |
807 <div> | |
808 <div> | |
809 <h4>Callback function</h4> | |
810 <p> | |
811 If you specify the <em>callback</em> parameter, it should | |
812 specify a function that looks like this: | |
813 </p> | |
814 <!-- Note: intentionally longer 80 columns --> | |
815 <pre>function(<span></span>) <span class="subdued">{...}</span
>;</pre> | |
816 <dl> | |
817 </dl> | |
818 </div> | |
819 </div> | |
820 <!-- MIN_VERSION --> | |
821 </div> <!-- /description --> | |
822 </div><div class="apiItem"> | |
823 <a name="method-removeAll"></a> <!-- method-anchor --> | |
824 <h4>removeAll</h4> | |
825 <div class="summary"> | |
826 <!-- Note: intentionally longer 80 columns --> | |
827 <span>chrome.contextMenus.removeAll</span>(<span class="option
al"><span>function</span> | |
828 <var><span>callback</span></var></span>)</div> | |
829 <div class="description"> | |
830 <p>Removes all context menu items added by this extension.</p> | |
831 <!-- PARAMETERS --> | |
832 <h4>Parameters</h4> | |
833 <dl> | |
834 <div> | |
835 <div> | |
836 <dt> | |
837 <var>callback</var> | |
838 <em> | |
839 <!-- TYPE --> | |
840 <div style="display:inline"> | |
841 ( | |
842 <span class="optional">optional</span> | |
843 <span id="typeTemplate"> | |
844 <span> | |
845 <span>function</span> | |
846 </span> | |
847 </span> | |
848 ) | |
849 </div> | |
850 </em> | |
851 </dt> | |
852 <dd>Called when removal is complete.</dd> | |
853 <!-- OBJECT PROPERTIES --> | |
854 <!-- OBJECT METHODS --> | |
855 <!-- OBJECT EVENT FIELDS --> | |
856 <!-- FUNCTION PARAMETERS --> | |
857 </div> | |
858 </div> | |
859 </dl> | |
860 <!-- RETURNS --> | |
861 <dl> | |
862 </dl> | |
863 <!-- CALLBACK --> | |
864 <div> | |
865 <div> | |
866 <h4>Callback function</h4> | |
867 <p> | |
868 If you specify the <em>callback</em> parameter, it should | |
869 specify a function that looks like this: | |
870 </p> | |
871 <!-- Note: intentionally longer 80 columns --> | |
872 <pre>function(<span></span>) <span class="subdued">{...}</span
>;</pre> | |
873 <dl> | |
874 </dl> | |
875 </div> | |
876 </div> | |
877 <!-- MIN_VERSION --> | |
878 </div> <!-- /description --> | |
879 </div><div class="apiItem"> | |
880 <a name="method-update"></a> <!-- method-anchor --> | |
881 <h4>update</h4> | |
882 <div class="summary"> | |
883 <!-- Note: intentionally longer 80 columns --> | |
884 <span>chrome.contextMenus.update</span>(<span class="null"><sp
an>integer or string</span> | |
885 <var><span>id</span></var></span><span class="null"><span>
, </span><span>object</span> | |
886 <var><span>updateProperties</span></var></span><span class
="optional"><span>, </span><span>function</span> | |
887 <var><span>callback</span></var></span>)</div> | |
888 <div class="description"> | |
889 <p>Updates a previously created context menu item.</p> | |
890 <!-- PARAMETERS --> | |
891 <h4>Parameters</h4> | |
892 <dl> | |
893 <div> | |
894 <div> | |
895 <dt> | |
896 <var>id</var> | |
897 <em> | |
898 <!-- TYPE --> | |
899 <div style="display:inline"> | |
900 ( | |
901 <span id="typeTemplate"> | |
902 <span> | |
903 <span>integer or string</span> | |
904 </span> | |
905 </span> | |
906 ) | |
907 </div> | |
908 </em> | |
909 </dt> | |
910 <dd>The ID of the item to update.</dd> | |
911 <!-- OBJECT PROPERTIES --> | |
912 <!-- OBJECT METHODS --> | |
913 <!-- OBJECT EVENT FIELDS --> | |
914 <!-- FUNCTION PARAMETERS --> | |
915 </div> | |
916 </div><div> | |
917 <div> | |
918 <dt> | |
919 <var>updateProperties</var> | |
920 <em> | |
921 <!-- TYPE --> | |
922 <div style="display:inline"> | |
923 ( | |
924 <span id="typeTemplate"> | |
925 <span> | |
926 <span>object</span> | |
927 </span> | |
928 </span> | |
929 ) | |
930 </div> | |
931 </em> | |
932 </dt> | |
933 <dd>The properties to update. Accepts the same values as the create fu
nction.</dd> | |
934 <!-- OBJECT PROPERTIES --> | |
935 <dd> | |
936 <dl> | |
937 <div> | |
938 <div> | |
939 <dt> | |
940 <var>type</var> | |
941 <em> | |
942 <!-- TYPE --> | |
943 <div style="display:inline"> | |
944 ( | |
945 <span class="optional">optional</span> | |
946 <span class="enum">enumerated</span> | |
947 <span id="typeTemplate"> | |
948 <span> | |
949 <span>string</span> | |
950 <span>["normal", "checkbox", "radio", "separator"]</span
> | |
951 </span> | |
952 </span> | |
953 ) | |
954 </div> | |
955 </em> | |
956 </dt> | |
957 <dd class="todo"> | |
958 Undocumented. | |
959 </dd> | |
960 <!-- OBJECT PROPERTIES --> | |
961 <!-- OBJECT METHODS --> | |
962 <!-- OBJECT EVENT FIELDS --> | |
963 <!-- FUNCTION PARAMETERS --> | |
964 </div> | |
965 </div><div> | |
966 <div> | |
967 <dt> | |
968 <var>title</var> | |
969 <em> | |
970 <!-- TYPE --> | |
971 <div style="display:inline"> | |
972 ( | |
973 <span class="optional">optional</span> | |
974 <span id="typeTemplate"> | |
975 <span> | |
976 <span>string</span> | |
977 </span> | |
978 </span> | |
979 ) | |
980 </div> | |
981 </em> | |
982 </dt> | |
983 <dd class="todo"> | |
984 Undocumented. | |
985 </dd> | |
986 <!-- OBJECT PROPERTIES --> | |
987 <!-- OBJECT METHODS --> | |
988 <!-- OBJECT EVENT FIELDS --> | |
989 <!-- FUNCTION PARAMETERS --> | |
990 </div> | |
991 </div><div> | |
992 <div> | |
993 <dt> | |
994 <var>checked</var> | |
995 <em> | |
996 <!-- TYPE --> | |
997 <div style="display:inline"> | |
998 ( | |
999 <span class="optional">optional</span> | |
1000 <span id="typeTemplate"> | |
1001 <span> | |
1002 <span>boolean</span> | |
1003 </span> | |
1004 </span> | |
1005 ) | |
1006 </div> | |
1007 </em> | |
1008 </dt> | |
1009 <dd class="todo"> | |
1010 Undocumented. | |
1011 </dd> | |
1012 <!-- OBJECT PROPERTIES --> | |
1013 <!-- OBJECT METHODS --> | |
1014 <!-- OBJECT EVENT FIELDS --> | |
1015 <!-- FUNCTION PARAMETERS --> | |
1016 </div> | |
1017 </div><div> | |
1018 <div> | |
1019 <dt> | |
1020 <var>contexts</var> | |
1021 <em> | |
1022 <!-- TYPE --> | |
1023 <div style="display:inline"> | |
1024 ( | |
1025 <span class="optional">optional</span> | |
1026 <span id="typeTemplate"> | |
1027 <span> | |
1028 <span> | |
1029 array of <span><span> | |
1030 <span> | |
1031 <span>string</span> | |
1032 <span>["all", "page", "frame", "selection", "link", "edi
table", "image", "video", "audio"]</span> | |
1033 </span> | |
1034 </span></span> | |
1035 </span> | |
1036 </span> | |
1037 </span> | |
1038 ) | |
1039 </div> | |
1040 </em> | |
1041 </dt> | |
1042 <dd class="todo"> | |
1043 Undocumented. | |
1044 </dd> | |
1045 <!-- OBJECT PROPERTIES --> | |
1046 <!-- OBJECT METHODS --> | |
1047 <!-- OBJECT EVENT FIELDS --> | |
1048 <!-- FUNCTION PARAMETERS --> | |
1049 </div> | |
1050 </div><div> | |
1051 <div> | |
1052 <dt> | |
1053 <var>onclick</var> | |
1054 <em> | |
1055 <!-- TYPE --> | |
1056 <div style="display:inline"> | |
1057 ( | |
1058 <span class="optional">optional</span> | |
1059 <span id="typeTemplate"> | |
1060 <span> | |
1061 <span>function</span> | |
1062 </span> | |
1063 </span> | |
1064 ) | |
1065 </div> | |
1066 </em> | |
1067 </dt> | |
1068 <dd class="todo"> | |
1069 Undocumented. | |
1070 </dd> | |
1071 <!-- OBJECT PROPERTIES --> | |
1072 <!-- OBJECT METHODS --> | |
1073 <!-- OBJECT EVENT FIELDS --> | |
1074 <!-- FUNCTION PARAMETERS --> | |
1075 </div> | |
1076 </div><div> | |
1077 <div> | |
1078 <dt> | |
1079 <var>parentId</var> | |
1080 <em> | |
1081 <!-- TYPE --> | |
1082 <div style="display:inline"> | |
1083 ( | |
1084 <span class="optional">optional</span> | |
1085 <span id="typeTemplate"> | |
1086 <span> | |
1087 <span>integer or string</span> | |
1088 </span> | |
1089 </span> | |
1090 ) | |
1091 </div> | |
1092 </em> | |
1093 </dt> | |
1094 <dd>Note: You cannot change an item to be a child of one of its own de
scendants.</dd> | |
1095 <!-- OBJECT PROPERTIES --> | |
1096 <!-- OBJECT METHODS --> | |
1097 <!-- OBJECT EVENT FIELDS --> | |
1098 <!-- FUNCTION PARAMETERS --> | |
1099 </div> | |
1100 </div><div> | |
1101 <div> | |
1102 <dt> | |
1103 <var>documentUrlPatterns</var> | |
1104 <em> | |
1105 <!-- TYPE --> | |
1106 <div style="display:inline"> | |
1107 ( | |
1108 <span class="optional">optional</span> | |
1109 <span id="typeTemplate"> | |
1110 <span> | |
1111 <span> | |
1112 array of <span><span> | |
1113 <span> | |
1114 <span>string</span> | |
1115 </span> | |
1116 </span></span> | |
1117 </span> | |
1118 </span> | |
1119 </span> | |
1120 ) | |
1121 </div> | |
1122 </em> | |
1123 </dt> | |
1124 <dd class="todo"> | |
1125 Undocumented. | |
1126 </dd> | |
1127 <!-- OBJECT PROPERTIES --> | |
1128 <!-- OBJECT METHODS --> | |
1129 <!-- OBJECT EVENT FIELDS --> | |
1130 <!-- FUNCTION PARAMETERS --> | |
1131 </div> | |
1132 </div><div> | |
1133 <div> | |
1134 <dt> | |
1135 <var>targetUrlPatterns</var> | |
1136 <em> | |
1137 <!-- TYPE --> | |
1138 <div style="display:inline"> | |
1139 ( | |
1140 <span class="optional">optional</span> | |
1141 <span id="typeTemplate"> | |
1142 <span> | |
1143 <span> | |
1144 array of <span><span> | |
1145 <span> | |
1146 <span>string</span> | |
1147 </span> | |
1148 </span></span> | |
1149 </span> | |
1150 </span> | |
1151 </span> | |
1152 ) | |
1153 </div> | |
1154 </em> | |
1155 </dt> | |
1156 <dd class="todo"> | |
1157 Undocumented. | |
1158 </dd> | |
1159 <!-- OBJECT PROPERTIES --> | |
1160 <!-- OBJECT METHODS --> | |
1161 <!-- OBJECT EVENT FIELDS --> | |
1162 <!-- FUNCTION PARAMETERS --> | |
1163 </div> | |
1164 </div><div> | |
1165 <div> | |
1166 <dt> | |
1167 <var>enabled</var> | |
1168 <em> | |
1169 <!-- TYPE --> | |
1170 <div style="display:inline"> | |
1171 ( | |
1172 <span class="optional">optional</span> | |
1173 <span id="typeTemplate"> | |
1174 <span> | |
1175 <span>boolean</span> | |
1176 </span> | |
1177 </span> | |
1178 ) | |
1179 </div> | |
1180 </em> | |
1181 </dt> | |
1182 <dd class="todo"> | |
1183 Undocumented. | |
1184 </dd> | |
1185 <!-- OBJECT PROPERTIES --> | |
1186 <!-- OBJECT METHODS --> | |
1187 <!-- OBJECT EVENT FIELDS --> | |
1188 <!-- FUNCTION PARAMETERS --> | |
1189 </div> | |
1190 </div> | |
1191 </dl> | |
1192 </dd> | |
1193 <!-- OBJECT METHODS --> | |
1194 <!-- OBJECT EVENT FIELDS --> | |
1195 <!-- FUNCTION PARAMETERS --> | |
1196 </div> | |
1197 </div><div> | |
1198 <div> | |
1199 <dt> | |
1200 <var>callback</var> | |
1201 <em> | |
1202 <!-- TYPE --> | |
1203 <div style="display:inline"> | |
1204 ( | |
1205 <span class="optional">optional</span> | |
1206 <span id="typeTemplate"> | |
1207 <span> | |
1208 <span>function</span> | |
1209 </span> | |
1210 </span> | |
1211 ) | |
1212 </div> | |
1213 </em> | |
1214 </dt> | |
1215 <dd>Called when the context menu has been updated.</dd> | |
1216 <!-- OBJECT PROPERTIES --> | |
1217 <!-- OBJECT METHODS --> | |
1218 <!-- OBJECT EVENT FIELDS --> | |
1219 <!-- FUNCTION PARAMETERS --> | |
1220 </div> | |
1221 </div> | |
1222 </dl> | |
1223 <!-- RETURNS --> | |
1224 <dl> | |
1225 </dl> | |
1226 <!-- CALLBACK --> | |
1227 <div> | |
1228 <div> | |
1229 <h4>Callback function</h4> | |
1230 <p> | |
1231 If you specify the <em>callback</em> parameter, it should | |
1232 specify a function that looks like this: | |
1233 </p> | |
1234 <!-- Note: intentionally longer 80 columns --> | |
1235 <pre>function(<span></span>) <span class="subdued">{...}</span
>;</pre> | |
1236 <dl> | |
1237 </dl> | |
1238 </div> | |
1239 </div> | |
1240 <!-- MIN_VERSION --> | |
1241 </div> <!-- /description --> | |
1242 </div> <!-- /apiItem --> | |
1243 </div> <!-- /apiGroup --> | |
1244 <!-- EVENTS --> | |
1245 <div id="eventsTemplate" class="apiGroup"> | |
1246 <a name="global-events"></a> | |
1247 <h3>Events</h3> | |
1248 <!-- iterates over all events --> | |
1249 <div class="apiItem"> | |
1250 <a name="event-onClicked"></a> | |
1251 <h4>onClicked</h4> | |
1252 <div class="summary"> | |
1253 <!-- Note: intentionally longer 80 columns --> | |
1254 <span class="subdued">chrome.contextMenus.</span><span>onClicked
</span><span class="subdued">.addListener</span>(function(<span>OnClickData info
, tabs.Tab tab</span>) <span class="subdued">{...}</span><span></span>); | |
1255 </div> | |
1256 <div class="description"> | |
1257 <p>Fired when a context menu item is clicked.</p> | |
1258 <!-- LISTENER PARAMETERS --> | |
1259 <div> | |
1260 <h4>Listener parameters</h4> | |
1261 <dl> | |
1262 <div> | |
1263 <div> | |
1264 <dt> | |
1265 <var>info</var> | |
1266 <em> | |
1267 <!-- TYPE --> | |
1268 <div style="display:inline"> | |
1269 ( | |
1270 <span id="typeTemplate"> | |
1271 <span> | |
1272 <a href="contextMenus.html#type-OnClickData">OnClickData
</a> | |
1273 </span> | |
1274 </span> | |
1275 ) | |
1276 </div> | |
1277 </em> | |
1278 </dt> | |
1279 <dd>Information about the item clicked and the context where the click
happened.</dd> | |
1280 <!-- OBJECT PROPERTIES --> | |
1281 <!-- OBJECT METHODS --> | |
1282 <!-- OBJECT EVENT FIELDS --> | |
1283 <!-- FUNCTION PARAMETERS --> | |
1284 </div> | |
1285 </div><div> | |
1286 <div> | |
1287 <dt> | |
1288 <var>tab</var> | |
1289 <em> | |
1290 <!-- TYPE --> | |
1291 <div style="display:inline"> | |
1292 ( | |
1293 <span id="typeTemplate"> | |
1294 <span> | |
1295 <a>tabs.Tab</a> | |
1296 </span> | |
1297 </span> | |
1298 ) | |
1299 </div> | |
1300 </em> | |
1301 </dt> | |
1302 <dd>The details of the tab where the click took place.</dd> | |
1303 <!-- OBJECT PROPERTIES --> | |
1304 <!-- OBJECT METHODS --> | |
1305 <!-- OBJECT EVENT FIELDS --> | |
1306 <!-- FUNCTION PARAMETERS --> | |
1307 </div> | |
1308 </div> | |
1309 </dl> | |
1310 </div> | |
1311 <!-- EXTRA PARAMETERS --> | |
1312 <!-- LISTENER RETURN VALUE --> | |
1313 <dl> | |
1314 </dl> | |
1315 </div> <!-- /description --> | |
1316 <!-- /description --> | |
1317 </div> <!-- /apiItem --> | |
1318 </div> <!-- /apiGroup --> | |
1319 <!-- TYPES --> | |
1320 <div class="apiGroup"> | |
1321 <a name="types"></a> | |
1322 <h3 id="types">Types</h3> | |
1323 <!-- iterates over all types --> | |
1324 <div class="apiItem"> | |
1325 <a name="type-OnClickData"></a> | |
1326 <h4>OnClickData</h4> | |
1327 <div> | |
1328 <dt> | |
1329 <em> | |
1330 <!-- TYPE --> | |
1331 <div style="display:inline"> | |
1332 ( | |
1333 <span id="typeTemplate"> | |
1334 <span> | |
1335 <span>object</span> | |
1336 </span> | |
1337 </span> | |
1338 ) | |
1339 </div> | |
1340 </em> | |
1341 </dt> | |
1342 <dd>Information sent when a context menu item is clicked.</dd> | |
1343 <!-- OBJECT PROPERTIES --> | |
1344 <dd> | |
1345 <dl> | |
1346 <div> | |
1347 <div> | |
1348 <dt> | |
1349 <var>menuItemId</var> | |
1350 <em> | |
1351 <!-- TYPE --> | |
1352 <div style="display:inline"> | |
1353 ( | |
1354 <span id="typeTemplate"> | |
1355 <span> | |
1356 <span>integer or string</span> | |
1357 </span> | |
1358 </span> | |
1359 ) | |
1360 </div> | |
1361 </em> | |
1362 </dt> | |
1363 <dd>The ID of the menu item that was clicked.</dd> | |
1364 <!-- OBJECT PROPERTIES --> | |
1365 <!-- OBJECT METHODS --> | |
1366 <!-- OBJECT EVENT FIELDS --> | |
1367 <!-- FUNCTION PARAMETERS --> | |
1368 </div> | |
1369 </div><div> | |
1370 <div> | |
1371 <dt> | |
1372 <var>parentMenuItemId</var> | |
1373 <em> | |
1374 <!-- TYPE --> | |
1375 <div style="display:inline"> | |
1376 ( | |
1377 <span class="optional">optional</span> | |
1378 <span id="typeTemplate"> | |
1379 <span> | |
1380 <span>integer or string</span> | |
1381 </span> | |
1382 </span> | |
1383 ) | |
1384 </div> | |
1385 </em> | |
1386 </dt> | |
1387 <dd>The parent ID, if any, for the item clicked.</dd> | |
1388 <!-- OBJECT PROPERTIES --> | |
1389 <!-- OBJECT METHODS --> | |
1390 <!-- OBJECT EVENT FIELDS --> | |
1391 <!-- FUNCTION PARAMETERS --> | |
1392 </div> | |
1393 </div><div> | |
1394 <div> | |
1395 <dt> | |
1396 <var>mediaType</var> | |
1397 <em> | |
1398 <!-- TYPE --> | |
1399 <div style="display:inline"> | |
1400 ( | |
1401 <span class="optional">optional</span> | |
1402 <span id="typeTemplate"> | |
1403 <span> | |
1404 <span>string</span> | |
1405 </span> | |
1406 </span> | |
1407 ) | |
1408 </div> | |
1409 </em> | |
1410 </dt> | |
1411 <dd>One of 'image', 'video', or 'audio' if the context menu was activa
ted on one of these types of elements.</dd> | |
1412 <!-- OBJECT PROPERTIES --> | |
1413 <!-- OBJECT METHODS --> | |
1414 <!-- OBJECT EVENT FIELDS --> | |
1415 <!-- FUNCTION PARAMETERS --> | |
1416 </div> | |
1417 </div><div> | |
1418 <div> | |
1419 <dt> | |
1420 <var>linkUrl</var> | |
1421 <em> | |
1422 <!-- TYPE --> | |
1423 <div style="display:inline"> | |
1424 ( | |
1425 <span class="optional">optional</span> | |
1426 <span id="typeTemplate"> | |
1427 <span> | |
1428 <span>string</span> | |
1429 </span> | |
1430 </span> | |
1431 ) | |
1432 </div> | |
1433 </em> | |
1434 </dt> | |
1435 <dd>If the element is a link, the URL it points to.</dd> | |
1436 <!-- OBJECT PROPERTIES --> | |
1437 <!-- OBJECT METHODS --> | |
1438 <!-- OBJECT EVENT FIELDS --> | |
1439 <!-- FUNCTION PARAMETERS --> | |
1440 </div> | |
1441 </div><div> | |
1442 <div> | |
1443 <dt> | |
1444 <var>srcUrl</var> | |
1445 <em> | |
1446 <!-- TYPE --> | |
1447 <div style="display:inline"> | |
1448 ( | |
1449 <span class="optional">optional</span> | |
1450 <span id="typeTemplate"> | |
1451 <span> | |
1452 <span>string</span> | |
1453 </span> | |
1454 </span> | |
1455 ) | |
1456 </div> | |
1457 </em> | |
1458 </dt> | |
1459 <dd>Will be present for elements with a 'src' URL.</dd> | |
1460 <!-- OBJECT PROPERTIES --> | |
1461 <!-- OBJECT METHODS --> | |
1462 <!-- OBJECT EVENT FIELDS --> | |
1463 <!-- FUNCTION PARAMETERS --> | |
1464 </div> | |
1465 </div><div> | |
1466 <div> | |
1467 <dt> | |
1468 <var>pageUrl</var> | |
1469 <em> | |
1470 <!-- TYPE --> | |
1471 <div style="display:inline"> | |
1472 ( | |
1473 <span id="typeTemplate"> | |
1474 <span> | |
1475 <span>string</span> | |
1476 </span> | |
1477 </span> | |
1478 ) | |
1479 </div> | |
1480 </em> | |
1481 </dt> | |
1482 <dd>The URL of the page where the menu item was clicked.</dd> | |
1483 <!-- OBJECT PROPERTIES --> | |
1484 <!-- OBJECT METHODS --> | |
1485 <!-- OBJECT EVENT FIELDS --> | |
1486 <!-- FUNCTION PARAMETERS --> | |
1487 </div> | |
1488 </div><div> | |
1489 <div> | |
1490 <dt> | |
1491 <var>frameUrl</var> | |
1492 <em> | |
1493 <!-- TYPE --> | |
1494 <div style="display:inline"> | |
1495 ( | |
1496 <span class="optional">optional</span> | |
1497 <span id="typeTemplate"> | |
1498 <span> | |
1499 <span>string</span> | |
1500 </span> | |
1501 </span> | |
1502 ) | |
1503 </div> | |
1504 </em> | |
1505 </dt> | |
1506 <dd> The URL of the frame of the element where the context menu was cl
icked, if it was in a frame.</dd> | |
1507 <!-- OBJECT PROPERTIES --> | |
1508 <!-- OBJECT METHODS --> | |
1509 <!-- OBJECT EVENT FIELDS --> | |
1510 <!-- FUNCTION PARAMETERS --> | |
1511 </div> | |
1512 </div><div> | |
1513 <div> | |
1514 <dt> | |
1515 <var>selectionText</var> | |
1516 <em> | |
1517 <!-- TYPE --> | |
1518 <div style="display:inline"> | |
1519 ( | |
1520 <span class="optional">optional</span> | |
1521 <span id="typeTemplate"> | |
1522 <span> | |
1523 <span>string</span> | |
1524 </span> | |
1525 </span> | |
1526 ) | |
1527 </div> | |
1528 </em> | |
1529 </dt> | |
1530 <dd>The text for the context selection, if any.</dd> | |
1531 <!-- OBJECT PROPERTIES --> | |
1532 <!-- OBJECT METHODS --> | |
1533 <!-- OBJECT EVENT FIELDS --> | |
1534 <!-- FUNCTION PARAMETERS --> | |
1535 </div> | |
1536 </div><div> | |
1537 <div> | |
1538 <dt> | |
1539 <var>editable</var> | |
1540 <em> | |
1541 <!-- TYPE --> | |
1542 <div style="display:inline"> | |
1543 ( | |
1544 <span id="typeTemplate"> | |
1545 <span> | |
1546 <span>boolean</span> | |
1547 </span> | |
1548 </span> | |
1549 ) | |
1550 </div> | |
1551 </em> | |
1552 </dt> | |
1553 <dd>A flag indicating whether the element is editable (text input, tex
tarea, etc.).</dd> | |
1554 <!-- OBJECT PROPERTIES --> | |
1555 <!-- OBJECT METHODS --> | |
1556 <!-- OBJECT EVENT FIELDS --> | |
1557 <!-- FUNCTION PARAMETERS --> | |
1558 </div> | |
1559 </div><div> | |
1560 <div> | |
1561 <dt> | |
1562 <var>wasChecked</var> | |
1563 <em> | |
1564 <!-- TYPE --> | |
1565 <div style="display:inline"> | |
1566 ( | |
1567 <span class="optional">optional</span> | |
1568 <span id="typeTemplate"> | |
1569 <span> | |
1570 <span>boolean</span> | |
1571 </span> | |
1572 </span> | |
1573 ) | |
1574 </div> | |
1575 </em> | |
1576 </dt> | |
1577 <dd>A flag indicating the state of a checkbox or radio item before it
was clicked.</dd> | |
1578 <!-- OBJECT PROPERTIES --> | |
1579 <!-- OBJECT METHODS --> | |
1580 <!-- OBJECT EVENT FIELDS --> | |
1581 <!-- FUNCTION PARAMETERS --> | |
1582 </div> | |
1583 </div><div> | |
1584 <div> | |
1585 <dt> | |
1586 <var>checked</var> | |
1587 <em> | |
1588 <!-- TYPE --> | |
1589 <div style="display:inline"> | |
1590 ( | |
1591 <span class="optional">optional</span> | |
1592 <span id="typeTemplate"> | |
1593 <span> | |
1594 <span>boolean</span> | |
1595 </span> | |
1596 </span> | |
1597 ) | |
1598 </div> | |
1599 </em> | |
1600 </dt> | |
1601 <dd>A flag indicating the state of a checkbox or radio item after it i
s clicked.</dd> | |
1602 <!-- OBJECT PROPERTIES --> | |
1603 <!-- OBJECT METHODS --> | |
1604 <!-- OBJECT EVENT FIELDS --> | |
1605 <!-- FUNCTION PARAMETERS --> | |
1606 </div> | |
1607 </div> | |
1608 </dl> | |
1609 </dd> | |
1610 <!-- OBJECT METHODS --> | |
1611 <!-- OBJECT EVENT FIELDS --> | |
1612 <!-- FUNCTION PARAMETERS --> | |
1613 </div> | |
1614 </div> <!-- /apiItem --> | |
1615 </div> <!-- /apiGroup --> | |
1616 </div> <!-- /apiPage --> | |
1617 </div> <!-- /gc-pagecontent --> | |
1618 </div> <!-- /g-section --> | |
1619 </div> <!-- /codesiteContent --> | |
1620 <div id="gc-footer" --=""> | |
1621 <div class="text"> | |
1622 <p> | |
1623 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
1624 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
1625 Attribution 3.0 License</a>, and code samples are licensed under the | |
1626 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
1627 </p> | |
1628 <p> | |
1629 ©2011 Google | |
1630 </p> | |
1631 <!-- begin analytics --> | |
1632 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
1633 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
1634 <script type="text/javascript"> | |
1635 // chrome doc tracking | |
1636 try { | |
1637 var engdocs = _gat._getTracker("YT-10763712-2"); | |
1638 engdocs._trackPageview(); | |
1639 } catch(err) {} | |
1640 // code.google.com site-wide tracking | |
1641 try { | |
1642 _uacct="UA-18071-1"; | |
1643 _uanchor=1; | |
1644 _uff=0; | |
1645 urchinTracker(); | |
1646 } | |
1647 catch(e) {/* urchinTracker not available. */} | |
1648 </script> | |
1649 <!-- end analytics --> | |
1650 </div> | |
1651 </div> <!-- /gc-footer --> | |
1652 </div> <!-- /gc-container --> | |
1653 </body></html> | |
OLD | NEW |