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/jstemplate_compiled.js"> 15 </script> 16 <script type="text/javascript" src="js/api_page_generator.js"></script> 17 <script type="text/javascript" src="js/bootstrap.js"></script> 18 <script type="text/javascript" src="js/sidebar.js"></script> 19 <title>Context Menus - Google Chrome Extensions - Google Code</title></head> 20 <body> <div id="gc-container" class="labs"> 21 <div id="devModeWarning"> 22 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. 23 </div> 24 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> 25 <!-- In particular, sub-templates that recurse, must be used by allowing 26 jstemplate to make a copy of the template in this section which 27 are not operated on by way of the jsskip="true" --> 28 <div style="display:none"> 29 30 <!-- VALUE --> 31 <div id="valueTemplate"> 32 <dt> 33 <var>paramName</var> 34 <em> 35 36 <!-- TYPE --> 37 <div style="display:inline"> 38 ( 39 <span class="optional">optional</span> 40 <span class="enum">enumerated</span> 41 <span id="typeTemplate"> 42 <span> 43 <a> Type</a> 44 </span> 45 <span> 46 <span> 47 array of <span><span></span></span> 48 </span> 49 <span>paramType</span> 50 <span></span> 51 </span> 52 </span> 53 ) 54 </div> 55 56 </em> 57 </dt> 58 <dd class="todo"> 59 Undocumented. 60 </dd> 61 <dd> 62 Description of this parameter from the json schema. 63 </dd> 64 <dd> 65 This parameter was added in version 66 <b><span></span></b>. 67 You must omit this parameter in earlier versions, 68 and you may omit it in any version. If you require this 69 parameter, the manifest key 70 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 71 can ensure that your extension won't be run in an earlier browser version. 72 </dd> 73 74 <!-- OBJECT PROPERTIES --> 75 <dd> 76 <dl> 77 <div> 78 <div> 79 </div> 80 </div> 81 </dl> 82 </dd> 83 84 <!-- OBJECT METHODS --> 85 <dd> 86 <div></div> 87 </dd> 88 89 <!-- OBJECT EVENT FIELDS --> 90 <dd> 91 <div></div> 92 </dd> 93 94 <!-- FUNCTION PARAMETERS --> 95 <dd> 96 <div></div> 97 </dd> 98 99 </div> <!-- /VALUE --> 100 101 <div id="functionParametersTemplate"> 102 <h5>Parameters</h5> 103 <dl> 104 <div> 105 <div> 106 </div> 107 </div> 108 </dl> 109 </div> 110 </div> <!-- /SUBTEMPLATES --> 111 112 <a id="top"></a> 113 <div id="skipto"> 114 <a href="#gc-pagecontent">Skip to page content</a> 115 <a href="#gc-toc">Skip to main navigation</a> 116 </div> 117 <!-- API HEADER --> 118 <table id="header" width="100%" cellspacing="0" border="0"> 119 <tbody><tr> 120 <td valign="middle"><a href="http://code.google.com/"><img src="images/code_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:0; margin:0;"></a></td> 121 <td valign="middle" width="100%" style="padding-left:0.6em;"> 122 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.5em"> 123 <div id="gsc-search-box"> 124 <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno"> 125 <input type="hidden" name="ie" value="UTF-8"> 126 <input type="text" name="q" value="" size="55"> 127 <input class="gsc-search-button" type="submit" name="sa" value="Search"> 128 <br> 129 <span class="greytext">e.g. "page action" or "tabs"</span> 130 </div> 131 </form> 132 133 <script type="text/javascript" src="http://www.google.com/jsapi"></script> 134 <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script> 135 <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse&t13n_langs=en"></script> 136 <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse&lang=en"></script> 137 </td> 138 </tr> 139 </tbody></table> 140 141 <div id="codesiteContent" class=""> 142 143 <a id="gc-topnav-anchor"></a> 144 <div id="gc-topnav"> 145 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Labs</a>)</h1> 146 <ul id="home" class="gc-topnav-tabs"> 147 <li id="home_link"> 148 <a href="index.html" title="Google Chrome Extensions home page">Home</a> 149 </li> 150 <li id="docs_link"> 151 <a href="docs.html" title="Official Google Chrome Extensions documentation">Docs</a> 152 </li> 153 <li id="faq_link"> 154 <a href="faq.html" title="Answers to frequently asked questions about Google Chrome Extensions">FAQ</a> 155 </li> 156 <li id="samples_link"> 157 <a href="samples.html" title="Sample extensions (with source code)">Samples</a> 158 </li> 159 <li id="group_link"> 160 <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions" title="Google Chrome Extensions developer forum">Group</a> 161 </li> 162 </ul> 163 </div> <!-- end gc-topnav --> 164 165 <div class="g-section g-tpl-170"> 166 <!-- SIDENAV --> 167 <div class="g-unit g-first" id="gc-toc"> 168 <ul> 169 <li><a href="getstarted.html">Getting Started</a></li> 170 <li><a href="overview.html">Overview</a></li> 171 <li><a href="whats_new.html">What's New?</a></li> 172 <li><h2><a href="devguide.html">Developer's Guide</a></h2> 173 <ul> 174 <li>Browser UI 175 <ul> 176 <li><a href="browserAction.html">Browser Actions</a></li> 177 <li class="leftNavSelected">Context Menus</li> 178 <li><a href="notifications.html">Desktop Notifications</a></li> 179 <li><a href="omnibox.html">Omnibox</a></li> 180 <li><a href="options.html">Options Pages</a></li> 181 <li><a href="override.html">Override Pages</a></li> 182 <li><a href="pageAction.html">Page Actions</a></li> 183 </ul> 184 </li> 185 <li>Browser Interaction 186 <ul> 187 <li><a href="bookmarks.html">Bookmarks</a></li> 188 <li><a href="cookies.html">Cookies</a></li> 189 <li><a href="events.html">Events</a></li> 190 <li><a href="history.html">History</a></li> 191 <li><a href="management.html">Management</a></li> 192 <li><a href="tabs.html">Tabs</a></li> 193 <li><a href="windows.html">Windows</a></li> 194 </ul> 195 </li> 196 <li>Implementation 197 <ul> 198 <li><a href="a11y.html">Accessibility</a></li> 199 <li><a href="background_pages.html">Background Pages</a></li> 200 <li><a href="content_scripts.html">Content Scripts</a></li> 201 <li><a href="xhr.html">Cross-Origin XHR</a></li> 202 <li><a href="idle.html">Idle</a></li> 203 <li><a href="i18n.html">Internationalization</a></li> 204 <li><a href="messaging.html">Message Passing</a></li> 205 <li><a href="npapi.html">NPAPI Plugins</a></li> 206 </ul> 207 </li> 208 <li>Finishing 209 <ul> 210 <li><a href="hosting.html">Hosting</a></li> 211 <li><a href="external_extensions.html">Other Deployment Options</a></li> 212 </ul> 213 </li> 214 </ul> 215 </li> 216 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> 217 <li><h2><a href="tutorials.html">Tutorials</a></h2> 218 <ul> 219 <li><a href="tut_debugging.html">Debugging</a></li> 220 <li><a href="tut_analytics.html">Google Analytics</a></li> 221 <li><a href="tut_oauth.html">OAuth</a></li> 222 </ul> 223 </li> 224 <li><h2>Reference</h2> 225 <ul> 226 <li>Formats 227 <ul> 228 <li><a href="manifest.html">Manifest Files</a></li> 229 <li><a href="match_patterns.html">Match Patterns</a></li> 230 </ul> 231 </li> 232 <li><a href="permission_warnings.html">Permission Warnings</a></li> 233 <li><a href="api_index.html">chrome.* APIs</a></li> 234 <li><a href="api_other.html">Other APIs</a></li> 235 </ul> 236 </li> 237 <li><h2><a href="samples.html">Samples</a></h2></li> 238 <div class="line"> </div> 239 <li><h2>More</h2> 240 <ul> 241 <li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li> 242 <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li> 243 <li><a href="themes.html">Themes</a></li> 244 </ul> 245 </li> 246 </ul> 247 </div> 248 <script> 249 initToggles(); 250 </script> 251 252 <div class="g-unit" id="gc-pagecontent"> 253 <div id="pageTitle"> 254 <h1 class="page_title">Context Menus</h1> 255 </div> 256 <!-- TABLE OF CONTENTS --> 257 <div id="toc"> 258 <h2>Contents</h2> 259 <ol> 260 <li> 261 <a href="#manifest">Manifest</a> 262 <ol> 263 <li style="display: none; "> 264 <a>h3Name</a> 265 </li> 266 </ol> 267 </li><li> 268 <a href="#examples">Examples</a> 269 <ol> 270 <li style="display: none; "> 271 <a>h3Name</a> 272 </li> 273 </ol> 274 </li> 275 <li> 276 <a href="#apiReference">API reference: chrome.contextMenus</a> 277 <ol> 278 <li style="display: none; "> 279 <a href="#properties">Properties</a> 280 <ol> 281 <li> 282 <a href="#property-anchor">propertyName</a> 283 </li> 284 </ol> 285 </li> 286 <li> 287 <a href="#global-methods">Methods</a> 288 <ol> 289 <li> 290 <a href="#method-create">create</a> 291 </li><li> 292 <a href="#method-remove">remove</a> 293 </li><li> 294 <a href="#method-removeAll">removeAll</a> 295 </li><li> 296 <a href="#method-update">update</a> 297 </li> 298 </ol> 299 </li> 300 <li style="display: none; "> 301 <a>Events</a> 302 <ol> 303 <li> 304 <a href="#event-anchor">eventName</a> 305 </li> 306 </ol> 307 </li> 308 <li> 309 <a href="#types">Types</a> 310 <ol> 311 <li> 312 <a href="#type-OnClickData">OnClickData</a> 313 </li> 314 </ol> 315 </li> 316 </ol> 317 </li> 318 </ol> 319 </div> 320 <!-- /TABLE OF CONTENTS --> 321 322 <!-- Standard content lead-in for experimental API pages --> 323 <p id="classSummary" style="display: none; "> 324 For information on how to use experimental APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page. 325 </p> 326 327 <!-- STATIC CONTENT PLACEHOLDER --> 328 <div id="static"><div id="pageData-name" class="pageData">Context Menus</div> 329 330 <!-- BEGIN AUTHORED CONTENT --> 331 <p> 332 The context menus module allows you 333 to add items to Google Chrome's context menu. 334 </p> 335 336 <p> 337 You can choose what types of objects 338 your context menu additions apply to, 339 such as images, hyperlinks, and pages. 340 </p> 341 342 <p> 343 You can create as many context menu items 344 as you need, but if more than one 345 from your extension is visible at once, 346 Google Chrome automatically collapses them 347 into a single parent menu. 348 </p> 349 350 <h2 id="manifest">Manifest</h2> 351 <p>You must declare the "contextMenus" permission 352 in your extension's manifest to use the API. 353 Also, you should specify a 16x16-pixel icon 354 for display next to your menu item. 355 For example: 356 </p> 357 358 <pre>{ 359 "name": "My extension", 360 ... 361 "permissions": [ 362 <b>"contextMenus"</b> 363 ], 364 "icons": { 365 <b>"16": "icon-bitty.png",</b> 366 "48": "icon-small.png", 367 "128": "icon-large.png" 368 }, 369 ... 370 }</pre> 371 372 <h2 id="examples">Examples</h2> 373 374 <p> 375 You can find samples of this API on the 376 <a href="samples.html#contextMenus">sample page</a>. 377 378 <!-- END AUTHORED CONTENT --> 379 </p></div> 380 381 <!-- API PAGE --> 382 <div class="apiPage"> 383 <a name="apiReference"></a> 384 <h2>API reference: chrome.contextMenus</h2> 385 386 <!-- PROPERTIES --> 387 <div class="apiGroup" style="display: none; "> 388 <a name="properties"></a> 389 <h3 id="properties">Properties</h3> 390 391 <div> 392 <a></a> 393 <h4>getLastError</h4> 394 <div class="summary"> 395 <!-- Note: intentionally longer 80 columns --> 396 <span>chrome.extension</span><span>lastError</span> 397 </div> 398 <div> 399 </div> 400 </div> 401 402 </div> <!-- /apiGroup --> 403 404 <!-- METHODS --> 405 <div id="methodsTemplate" class="apiGroup"> 406 <a name="global-methods"></a> 407 <h3>Methods</h3> 408 409 <!-- iterates over all functions --> 410 <div class="apiItem"> 411 <a name="method-create"></a> <!-- method-anchor --> 412 <h4>create</h4> 413 414 <div class="summary"><span>integer</span> 415 <!-- Note: intentionally longer 80 columns --> 416 <span>chrome.contextMenus.create</span>(<span class="null"><span style="display: none; ">, </span><span>object</span> 417 <var><span>createProperties</span></var></span><span class="optional"><span>, </span><span>function</span> 418 <var><span>callback</span></var></span>)</div> 419 420 <div class="description"> 421 <p class="todo" style="display: none; ">Undocumented.</p> 422 <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 details will be in chrome.extension.lastError).</p> 423 424 <!-- PARAMETERS --> 425 <h4>Parameters</h4> 426 <dl> 427 <div> 428 <div> 429 <dt> 430 <var>createProperties</var> 431 <em> 432 433 <!-- TYPE --> 434 <div style="display:inline"> 435 ( 436 <span class="optional" style="display: none; ">optional</span> 437 <span class="enum" style="display: none; ">enumerated</span> 438 <span id="typeTemplate"> 439 <span style="display: none; "> 440 <a> Type</a> 441 </span> 442 <span> 443 <span style="display: none; "> 444 array of <span><span></span></span> 445 </span> 446 <span>object</span> 447 <span style="display: none; "></span> 448 </span> 449 </span> 450 ) 451 </div> 452 453 </em> 454 </dt> 455 <dd class="todo"> 456 Undocumented. 457 </dd> 458 <dd style="display: none; "> 459 Description of this parameter from the json schema. 460 </dd> 461 <dd style="display: none; "> 462 This parameter was added in version 463 <b><span></span></b>. 464 You must omit this parameter in earlier versions, 465 and you may omit it in any version. If you require this 466 parameter, the manifest key 467 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 468 can ensure that your extension won't be run in an earlier browser version. 469 </dd> 470 471 <!-- OBJECT PROPERTIES --> 472 <dd> 473 <dl> 474 <div> 475 <div> 476 <dt> 477 <var>type</var> 478 <em> 479 480 <!-- TYPE --> 481 <div style="display:inline"> 482 ( 483 <span class="optional">optional</span> 484 <span class="enum">enumerated</span> 485 <span id="typeTemplate"> 486 <span style="display: none; "> 487 <a> Type</a> 488 </span> 489 <span> 490 <span style="display: none; "> 491 array of <span><span></span></span> 492 </span> 493 <span>string</span> 494 <span>["normal", "checkbox", "radio", "separator"]</span> 495 </span> 496 </span> 497 ) 498 </div> 499 500 </em> 501 </dt> 502 <dd class="todo" style="display: none; "> 503 Undocumented. 504 </dd> 505 <dd>The type of menu item. Defaults to 'normal' if not specified.</dd> 506 <dd style="display: none; "> 507 This parameter was added in version 508 <b><span></span></b>. 509 You must omit this parameter in earlier versions, 510 and you may omit it in any version. If you require this 511 parameter, the manifest key 512 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 513 can ensure that your extension won't be run in an earlier browser version. 514 </dd> 515 516 <!-- OBJECT PROPERTIES --> 517 <dd style="display: none; "> 518 <dl> 519 <div> 520 <div> 521 </div> 522 </div> 523 </dl> 524 </dd> 525 526 <!-- OBJECT METHODS --> 527 <dd style="display: none; "> 528 <div></div> 529 </dd> 530 531 <!-- OBJECT EVENT FIELDS --> 532 <dd style="display: none; "> 533 <div></div> 534 </dd> 535 536 <!-- FUNCTION PARAMETERS --> 537 <dd style="display: none; "> 538 <div></div> 539 </dd> 540 541 </div> 542 </div><div> 543 <div> 544 <dt> 545 <var>title</var> 546 <em> 547 548 <!-- TYPE --> 549 <div style="display:inline"> 550 ( 551 <span class="optional">optional</span> 552 <span class="enum" style="display: none; ">enumerated</span> 553 <span id="typeTemplate"> 554 <span style="display: none; "> 555 <a> Type</a> 556 </span> 557 <span> 558 <span style="display: none; "> 559 array of <span><span></span></span> 560 </span> 561 <span>string</span> 562 <span style="display: none; "></span> 563 </span> 564 </span> 565 ) 566 </div> 567 568 </em> 569 </dt> 570 <dd class="todo" style="display: none; "> 571 Undocumented. 572 </dd> 573 <dd>The text to be displayed in the item; this is <em>required</em> unless <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 this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin".</dd> 574 <dd style="display: none; "> 575 This parameter was added in version 576 <b><span></span></b>. 577 You must omit this parameter in earlier versions, 578 and you may omit it in any version. If you require this 579 parameter, the manifest key 580 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 581 can ensure that your extension won't be run in an earlier browser version. 582 </dd> 583 584 <!-- OBJECT PROPERTIES --> 585 <dd style="display: none; "> 586 <dl> 587 <div> 588 <div> 589 </div> 590 </div> 591 </dl> 592 </dd> 593 594 <!-- OBJECT METHODS --> 595 <dd style="display: none; "> 596 <div></div> 597 </dd> 598 599 <!-- OBJECT EVENT FIELDS --> 600 <dd style="display: none; "> 601 <div></div> 602 </dd> 603 604 <!-- FUNCTION PARAMETERS --> 605 <dd style="display: none; "> 606 <div></div> 607 </dd> 608 609 </div> 610 </div><div> 611 <div> 612 <dt> 613 <var>checked</var> 614 <em> 615 616 <!-- TYPE --> 617 <div style="display:inline"> 618 ( 619 <span class="optional">optional</span> 620 <span class="enum" style="display: none; ">enumerated</span> 621 <span id="typeTemplate"> 622 <span style="display: none; "> 623 <a> Type</a> 624 </span> 625 <span> 626 <span style="display: none; "> 627 array of <span><span></span></span> 628 </span> 629 <span>boolean</span> 630 <span style="display: none; "></span> 631 </span> 632 </span> 633 ) 634 </div> 635 636 </em> 637 </dt> 638 <dd class="todo" style="display: none; "> 639 Undocumented. 640 </dd> 641 <dd>The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items.</dd> 642 <dd style="display: none; "> 643 This parameter was added in version 644 <b><span></span></b>. 645 You must omit this parameter in earlier versions, 646 and you may omit it in any version. If you require this 647 parameter, the manifest key 648 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 649 can ensure that your extension won't be run in an earlier browser version. 650 </dd> 651 652 <!-- OBJECT PROPERTIES --> 653 <dd style="display: none; "> 654 <dl> 655 <div> 656 <div> 657 </div> 658 </div> 659 </dl> 660 </dd> 661 662 <!-- OBJECT METHODS --> 663 <dd style="display: none; "> 664 <div></div> 665 </dd> 666 667 <!-- OBJECT EVENT FIELDS --> 668 <dd style="display: none; "> 669 <div></div> 670 </dd> 671 672 <!-- FUNCTION PARAMETERS --> 673 <dd style="display: none; "> 674 <div></div> 675 </dd> 676 677 </div> 678 </div><div> 679 <div> 680 <dt> 681 <var>contexts</var> 682 <em> 683 684 <!-- TYPE --> 685 <div style="display:inline"> 686 ( 687 <span class="optional">optional</span> 688 <span class="enum" style="display: none; ">enumerated</span> 689 <span id="typeTemplate"> 690 <span style="display: none; "> 691 <a> Type</a> 692 </span> 693 <span> 694 <span> 695 array of <span><span> 696 <span style="display: none; "> 697 <a> Type</a> 698 </span> 699 <span> 700 <span style="display: none; "> 701 array of <span><span></span></span> 702 </span> 703 <span>string</span> 704 <span>["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio"]</span> 705 </span> 706 </span></span> 707 </span> 708 <span style="display: none; ">paramType</span> 709 <span style="display: none; "></span> 710 </span> 711 </span> 712 ) 713 </div> 714 715 </em> 716 </dt> 717 <dd class="todo" style="display: none; "> 718 Undocumented. 719 </dd> 720 <dd>List of contexts this menu item will appear in. Defaults to ['page'] if not specified.</dd> 721 <dd style="display: none; "> 722 This parameter was added in version 723 <b><span></span></b>. 724 You must omit this parameter in earlier versions, 725 and you may omit it in any version. If you require this 726 parameter, the manifest key 727 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 728 can ensure that your extension won't be run in an earlier browser version. 729 </dd> 730 731 <!-- OBJECT PROPERTIES --> 732 <dd style="display: none; "> 733 <dl> 734 <div> 735 <div> 736 </div> 737 </div> 738 </dl> 739 </dd> 740 741 <!-- OBJECT METHODS --> 742 <dd style="display: none; "> 743 <div></div> 744 </dd> 745 746 <!-- OBJECT EVENT FIELDS --> 747 <dd style="display: none; "> 748 <div></div> 749 </dd> 750 751 <!-- FUNCTION PARAMETERS --> 752 <dd style="display: none; "> 753 <div></div> 754 </dd> 755 756 </div> 757 </div><div> 758 <div> 759 <dt> 760 <var>onclick</var> 761 <em> 762 763 <!-- TYPE --> 764 <div style="display:inline"> 765 ( 766 <span class="optional">optional</span> 767 <span class="enum" style="display: none; ">enumerated</span> 768 <span id="typeTemplate"> 769 <span style="display: none; "> 770 <a> Type</a> 771 </span> 772 <span> 773 <span style="display: none; "> 774 array of <span><span></span></span> 775 </span> 776 <span>function</span> 777 <span style="display: none; "></span> 778 </span> 779 </span> 780 ) 781 </div> 782 783 </em> 784 </dt> 785 <dd class="todo" style="display: none; "> 786 Undocumented. 787 </dd> 788 <dd>A function that will be called back when the menu item is clicked.</dd> 789 <dd style="display: none; "> 790 This parameter was added in version 791 <b><span></span></b>. 792 You must omit this parameter in earlier versions, 793 and you may omit it in any version. If you require this 794 parameter, the manifest key 795 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 796 can ensure that your extension won't be run in an earlier browser version. 797 </dd> 798 799 <!-- OBJECT PROPERTIES --> 800 <dd style="display: none; "> 801 <dl> 802 <div> 803 <div> 804 </div> 805 </div> 806 </dl> 807 </dd> 808 809 <!-- OBJECT METHODS --> 810 <dd style="display: none; "> 811 <div></div> 812 </dd> 813 814 <!-- OBJECT EVENT FIELDS --> 815 <dd style="display: none; "> 816 <div></div> 817 </dd> 818 819 <!-- FUNCTION PARAMETERS --> 820 <dd> 821 <div> 822 <h5>Parameters</h5> 823 <dl> 824 <div> 825 <div> 826 <dt> 827 <var>info</var> 828 <em> 829 830 <!-- TYPE --> 831 <div style="display:inline"> 832 ( 833 <span class="optional" style="display: none; ">optional</span> 834 <span class="enum" style="display: none; ">enumerated</span> 835 <span id="typeTemplate"> 836 <span> 837 <a href="contextMenus.html#type-OnClickData">OnClickData</a> 838 </span> 839 <span style="display: none; "> 840 <span> 841 array of <span><span></span></span> 842 </span> 843 <span>paramType</span> 844 <span></span> 845 </span> 846 </span> 847 ) 848 </div> 849 850 </em> 851 </dt> 852 <dd class="todo" style="display: none; "> 853 Undocumented. 854 </dd> 855 <dd>Information about the item clicked and the context where the click happened.</dd> 856 <dd style="display: none; "> 857 This parameter was added in version 858 <b><span></span></b>. 859 You must omit this parameter in earlier versions, 860 and you may omit it in any version. If you require this 861 parameter, the manifest key 862 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 863 can ensure that your extension won't be run in an earlier browser version. 864 </dd> 865 866 <!-- OBJECT PROPERTIES --> 867 <dd style="display: none; "> 868 <dl> 869 <div> 870 <div> 871 </div> 872 </div> 873 </dl> 874 </dd> 875 876 <!-- OBJECT METHODS --> 877 <dd style="display: none; "> 878 <div></div> 879 </dd> 880 881 <!-- OBJECT EVENT FIELDS --> 882 <dd style="display: none; "> 883 <div></div> 884 </dd> 885 886 <!-- FUNCTION PARAMETERS --> 887 <dd style="display: none; "> 888 <div></div> 889 </dd> 890 891 </div> 892 </div><div> 893 <div> 894 <dt> 895 <var>tab</var> 896 <em> 897 898 <!-- TYPE --> 899 <div style="display:inline"> 900 ( 901 <span class="optional" style="display: none; ">optional</span> 902 <span class="enum" style="display: none; ">enumerated</span> 903 <span id="typeTemplate"> 904 <span> 905 <a href="tabs.html#type-Tab">Tab</a> 906 </span> 907 <span style="display: none; "> 908 <span> 909 array of <span><span></span></span> 910 </span> 911 <span>paramType</span> 912 <span></span> 913 </span> 914 </span> 915 ) 916 </div> 917 918 </em> 919 </dt> 920 <dd class="todo" style="display: none; "> 921 Undocumented. 922 </dd> 923 <dd>The details of the tab where the click took place.</dd> 924 <dd style="display: none; "> 925 This parameter was added in version 926 <b><span></span></b>. 927 You must omit this parameter in earlier versions, 928 and you may omit it in any version. If you require this 929 parameter, the manifest key 930 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 931 can ensure that your extension won't be run in an earlier browser version. 932 </dd> 933 934 <!-- OBJECT PROPERTIES --> 935 <dd style="display: none; "> 936 <dl> 937 <div> 938 <div> 939 </div> 940 </div> 941 </dl> 942 </dd> 943 944 <!-- OBJECT METHODS --> 945 <dd style="display: none; "> 946 <div></div> 947 </dd> 948 949 <!-- OBJECT EVENT FIELDS --> 950 <dd style="display: none; "> 951 <div></div> 952 </dd> 953 954 <!-- FUNCTION PARAMETERS --> 955 <dd style="display: none; "> 956 <div></div> 957 </dd> 958 959 </div> 960 </div> 961 </dl> 962 </div> 963 </dd> 964 965 </div> 966 </div><div> 967 <div> 968 <dt> 969 <var>parentId</var> 970 <em> 971 972 <!-- TYPE --> 973 <div style="display:inline"> 974 ( 975 <span class="optional">optional</span> 976 <span class="enum" style="display: none; ">enumerated</span> 977 <span id="typeTemplate"> 978 <span style="display: none; "> 979 <a> Type</a> 980 </span> 981 <span> 982 <span style="display: none; "> 983 array of <span><span></span></span> 984 </span> 985 <span>integer</span> 986 <span style="display: none; "></span> 987 </span> 988 </span> 989 ) 990 </div> 991 992 </em> 993 </dt> 994 <dd class="todo" style="display: none; "> 995 Undocumented. 996 </dd> 997 <dd>The ID of a parent menu item; this makes the item a child of a previously added item.</dd> 998 <dd style="display: none; "> 999 This parameter was added in version 1000 <b><span></span></b>. 1001 You must omit this parameter in earlier versions, 1002 and you may omit it in any version. If you require this 1003 parameter, the manifest key 1004 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1005 can ensure that your extension won't be run in an earlier browser version. 1006 </dd> 1007 1008 <!-- OBJECT PROPERTIES --> 1009 <dd style="display: none; "> 1010 <dl> 1011 <div> 1012 <div> 1013 </div> 1014 </div> 1015 </dl> 1016 </dd> 1017 1018 <!-- OBJECT METHODS --> 1019 <dd style="display: none; "> 1020 <div></div> 1021 </dd> 1022 1023 <!-- OBJECT EVENT FIELDS --> 1024 <dd style="display: none; "> 1025 <div></div> 1026 </dd> 1027 1028 <!-- FUNCTION PARAMETERS --> 1029 <dd style="display: none; "> 1030 <div></div> 1031 </dd> 1032 1033 </div> 1034 </div><div> 1035 <div> 1036 <dt> 1037 <var>documentUrlPatterns</var> 1038 <em> 1039 1040 <!-- TYPE --> 1041 <div style="display:inline"> 1042 ( 1043 <span class="optional">optional</span> 1044 <span class="enum" style="display: none; ">enumerated</span> 1045 <span id="typeTemplate"> 1046 <span style="display: none; "> 1047 <a> Type</a> 1048 </span> 1049 <span> 1050 <span> 1051 array of <span><span> 1052 <span style="display: none; "> 1053 <a> Type</a> 1054 </span> 1055 <span> 1056 <span style="display: none; "> 1057 array of <span><span></span></span> 1058 </span> 1059 <span>string</span> 1060 <span style="display: none; "></span> 1061 </span> 1062 </span></span> 1063 </span> 1064 <span style="display: none; ">paramType</span> 1065 <span style="display: none; "></span> 1066 </span> 1067 </span> 1068 ) 1069 </div> 1070 1071 </em> 1072 </dt> 1073 <dd class="todo" style="display: none; "> 1074 Undocumented. 1075 </dd> 1076 <dd>Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see <a href="match_patterns.html">Match Patterns</a>.</dd> 1077 <dd style="display: none; "> 1078 This parameter was added in version 1079 <b><span></span></b>. 1080 You must omit this parameter in earlier versions, 1081 and you may omit it in any version. If you require this 1082 parameter, the manifest key 1083 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1084 can ensure that your extension won't be run in an earlier browser version. 1085 </dd> 1086 1087 <!-- OBJECT PROPERTIES --> 1088 <dd style="display: none; "> 1089 <dl> 1090 <div> 1091 <div> 1092 </div> 1093 </div> 1094 </dl> 1095 </dd> 1096 1097 <!-- OBJECT METHODS --> 1098 <dd style="display: none; "> 1099 <div></div> 1100 </dd> 1101 1102 <!-- OBJECT EVENT FIELDS --> 1103 <dd style="display: none; "> 1104 <div></div> 1105 </dd> 1106 1107 <!-- FUNCTION PARAMETERS --> 1108 <dd style="display: none; "> 1109 <div></div> 1110 </dd> 1111 1112 </div> 1113 </div><div> 1114 <div> 1115 <dt> 1116 <var>targetUrlPatterns</var> 1117 <em> 1118 1119 <!-- TYPE --> 1120 <div style="display:inline"> 1121 ( 1122 <span class="optional">optional</span> 1123 <span class="enum" style="display: none; ">enumerated</span> 1124 <span id="typeTemplate"> 1125 <span style="display: none; "> 1126 <a> Type</a> 1127 </span> 1128 <span> 1129 <span> 1130 array of <span><span> 1131 <span style="display: none; "> 1132 <a> Type</a> 1133 </span> 1134 <span> 1135 <span style="display: none; "> 1136 array of <span><span></span></span> 1137 </span> 1138 <span>string</span> 1139 <span style="display: none; "></span> 1140 </span> 1141 </span></span> 1142 </span> 1143 <span style="display: none; ">paramType</span> 1144 <span style="display: none; "></span> 1145 </span> 1146 </span> 1147 ) 1148 </div> 1149 1150 </em> 1151 </dt> 1152 <dd class="todo" style="display: none; "> 1153 Undocumented. 1154 </dd> 1155 <dd>Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags.</dd> 1156 <dd style="display: none; "> 1157 This parameter was added in version 1158 <b><span></span></b>. 1159 You must omit this parameter in earlier versions, 1160 and you may omit it in any version. If you require this 1161 parameter, the manifest key 1162 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1163 can ensure that your extension won't be run in an earlier browser version. 1164 </dd> 1165 1166 <!-- OBJECT PROPERTIES --> 1167 <dd style="display: none; "> 1168 <dl> 1169 <div> 1170 <div> 1171 </div> 1172 </div> 1173 </dl> 1174 </dd> 1175 1176 <!-- OBJECT METHODS --> 1177 <dd style="display: none; "> 1178 <div></div> 1179 </dd> 1180 1181 <!-- OBJECT EVENT FIELDS --> 1182 <dd style="display: none; "> 1183 <div></div> 1184 </dd> 1185 1186 <!-- FUNCTION PARAMETERS --> 1187 <dd style="display: none; "> 1188 <div></div> 1189 </dd> 1190 1191 </div> 1192 </div> 1193 </dl> 1194 </dd> 1195 1196 <!-- OBJECT METHODS --> 1197 <dd style="display: none; "> 1198 <div></div> 1199 </dd> 1200 1201 <!-- OBJECT EVENT FIELDS --> 1202 <dd style="display: none; "> 1203 <div></div> 1204 </dd> 1205 1206 <!-- FUNCTION PARAMETERS --> 1207 <dd style="display: none; "> 1208 <div></div> 1209 </dd> 1210 1211 </div> 1212 </div><div> 1213 <div> 1214 <dt> 1215 <var>callback</var> 1216 <em> 1217 1218 <!-- TYPE --> 1219 <div style="display:inline"> 1220 ( 1221 <span class="optional">optional</span> 1222 <span class="enum" style="display: none; ">enumerated</span> 1223 <span id="typeTemplate"> 1224 <span style="display: none; "> 1225 <a> Type</a> 1226 </span> 1227 <span> 1228 <span style="display: none; "> 1229 array of <span><span></span></span> 1230 </span> 1231 <span>function</span> 1232 <span style="display: none; "></span> 1233 </span> 1234 </span> 1235 ) 1236 </div> 1237 1238 </em> 1239 </dt> 1240 <dd class="todo" style="display: none; "> 1241 Undocumented. 1242 </dd> 1243 <dd>Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.extension.lastError.</dd> 1244 <dd style="display: none; "> 1245 This parameter was added in version 1246 <b><span></span></b>. 1247 You must omit this parameter in earlier versions, 1248 and you may omit it in any version. If you require this 1249 parameter, the manifest key 1250 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1251 can ensure that your extension won't be run in an earlier browser version. 1252 </dd> 1253 1254 <!-- OBJECT PROPERTIES --> 1255 <dd style="display: none; "> 1256 <dl> 1257 <div> 1258 <div> 1259 </div> 1260 </div> 1261 </dl> 1262 </dd> 1263 1264 <!-- OBJECT METHODS --> 1265 <dd style="display: none; "> 1266 <div></div> 1267 </dd> 1268 1269 <!-- OBJECT EVENT FIELDS --> 1270 <dd style="display: none; "> 1271 <div></div> 1272 </dd> 1273 1274 <!-- FUNCTION PARAMETERS --> 1275 <dd style="display: none; "> 1276 <div></div> 1277 </dd> 1278 1279 </div> 1280 </div> 1281 </dl> 1282 1283 <!-- RETURNS --> 1284 <h4>Returns</h4> 1285 <dl> 1286 <div> 1287 <div> 1288 <dt> 1289 <var style="display: none; ">paramName</var> 1290 <em> 1291 1292 <!-- TYPE --> 1293 <div style="display:inline"> 1294 ( 1295 <span class="optional" style="display: none; ">optional</span> 1296 <span class="enum" style="display: none; ">enumerated</span> 1297 <span id="typeTemplate"> 1298 <span style="display: none; "> 1299 <a> Type</a> 1300 </span> 1301 <span> 1302 <span style="display: none; "> 1303 array of <span><span></span></span> 1304 </span> 1305 <span>integer</span> 1306 <span style="display: none; "></span> 1307 </span> 1308 </span> 1309 ) 1310 </div> 1311 1312 </em> 1313 </dt> 1314 <dd class="todo" style="display: none; "> 1315 Undocumented. 1316 </dd> 1317 <dd>The ID of the newly created item.</dd> 1318 <dd style="display: none; "> 1319 This parameter was added in version 1320 <b><span></span></b>. 1321 You must omit this parameter in earlier versions, 1322 and you may omit it in any version. If you require this 1323 parameter, the manifest key 1324 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1325 can ensure that your extension won't be run in an earlier browser version. 1326 </dd> 1327 1328 <!-- OBJECT PROPERTIES --> 1329 <dd style="display: none; "> 1330 <dl> 1331 <div> 1332 <div> 1333 </div> 1334 </div> 1335 </dl> 1336 </dd> 1337 1338 <!-- OBJECT METHODS --> 1339 <dd style="display: none; "> 1340 <div></div> 1341 </dd> 1342 1343 <!-- OBJECT EVENT FIELDS --> 1344 <dd style="display: none; "> 1345 <div></div> 1346 </dd> 1347 1348 <!-- FUNCTION PARAMETERS --> 1349 <dd style="display: none; "> 1350 <div></div> 1351 </dd> 1352 1353 </div> 1354 </div> 1355 </dl> 1356 1357 <!-- CALLBACK --> 1358 <div> 1359 <div> 1360 <h4>Callback function</h4> 1361 <p style="display: none; "> 1362 The callback <em>parameter</em> should specify a function 1363 that looks like this: 1364 </p> 1365 <p> 1366 If you specify the <em>callback</em> parameter, it should 1367 specify a function that looks like this: 1368 </p> 1369 1370 <!-- Note: intentionally longer 80 columns --> 1371 <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre> 1372 <dl> 1373 <div style="display: none; "> 1374 <div> 1375 </div> 1376 </div> 1377 </dl> 1378 </div> 1379 </div> 1380 1381 <!-- MIN_VERSION --> 1382 <p style="display: none; "> 1383 This function was added in version <b><span></span></b>. 1384 If you require this function, the manifest key 1385 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1386 can ensure that your extension won't be run in an earlier browser version. 1387 </p> 1388 </div> <!-- /description --> 1389 1390 </div><div class="apiItem"> 1391 <a name="method-remove"></a> <!-- method-anchor --> 1392 <h4>remove</h4> 1393 1394 <div class="summary"><span style="display: none; ">void</span> 1395 <!-- Note: intentionally longer 80 columns --> 1396 <span>chrome.contextMenus.remove</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span> 1397 <var><span>menuItemId</span></var></span><span class="optional"><span>, </span><span>function</span> 1398 <var><span>callback</span></var></span>)</div> 1399 1400 <div class="description"> 1401 <p class="todo" style="display: none; ">Undocumented.</p> 1402 <p>Remove a context menu item.</p> 1403 1404 <!-- PARAMETERS --> 1405 <h4>Parameters</h4> 1406 <dl> 1407 <div> 1408 <div> 1409 <dt> 1410 <var>menuItemId</var> 1411 <em> 1412 1413 <!-- TYPE --> 1414 <div style="display:inline"> 1415 ( 1416 <span class="optional" style="display: none; ">optional</span> 1417 <span class="enum" style="display: none; ">enumerated</span> 1418 <span id="typeTemplate"> 1419 <span style="display: none; "> 1420 <a> Type</a> 1421 </span> 1422 <span> 1423 <span style="display: none; "> 1424 array of <span><span></span></span> 1425 </span> 1426 <span>integer</span> 1427 <span style="display: none; "></span> 1428 </span> 1429 </span> 1430 ) 1431 </div> 1432 1433 </em> 1434 </dt> 1435 <dd class="todo" style="display: none; "> 1436 Undocumented. 1437 </dd> 1438 <dd>The ID of the context menu item to remove.</dd> 1439 <dd style="display: none; "> 1440 This parameter was added in version 1441 <b><span></span></b>. 1442 You must omit this parameter in earlier versions, 1443 and you may omit it in any version. If you require this 1444 parameter, the manifest key 1445 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1446 can ensure that your extension won't be run in an earlier browser version. 1447 </dd> 1448 1449 <!-- OBJECT PROPERTIES --> 1450 <dd style="display: none; "> 1451 <dl> 1452 <div> 1453 <div> 1454 </div> 1455 </div> 1456 </dl> 1457 </dd> 1458 1459 <!-- OBJECT METHODS --> 1460 <dd style="display: none; "> 1461 <div></div> 1462 </dd> 1463 1464 <!-- OBJECT EVENT FIELDS --> 1465 <dd style="display: none; "> 1466 <div></div> 1467 </dd> 1468 1469 <!-- FUNCTION PARAMETERS --> 1470 <dd style="display: none; "> 1471 <div></div> 1472 </dd> 1473 1474 </div> 1475 </div><div> 1476 <div> 1477 <dt> 1478 <var>callback</var> 1479 <em> 1480 1481 <!-- TYPE --> 1482 <div style="display:inline"> 1483 ( 1484 <span class="optional">optional</span> 1485 <span class="enum" style="display: none; ">enumerated</span> 1486 <span id="typeTemplate"> 1487 <span style="display: none; "> 1488 <a> Type</a> 1489 </span> 1490 <span> 1491 <span style="display: none; "> 1492 array of <span><span></span></span> 1493 </span> 1494 <span>function</span> 1495 <span style="display: none; "></span> 1496 </span> 1497 </span> 1498 ) 1499 </div> 1500 1501 </em> 1502 </dt> 1503 <dd class="todo" style="display: none; "> 1504 Undocumented. 1505 </dd> 1506 <dd>Called when the context menu has been removed.</dd> 1507 <dd style="display: none; "> 1508 This parameter was added in version 1509 <b><span></span></b>. 1510 You must omit this parameter in earlier versions, 1511 and you may omit it in any version. If you require this 1512 parameter, the manifest key 1513 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1514 can ensure that your extension won't be run in an earlier browser version. 1515 </dd> 1516 1517 <!-- OBJECT PROPERTIES --> 1518 <dd style="display: none; "> 1519 <dl> 1520 <div> 1521 <div> 1522 </div> 1523 </div> 1524 </dl> 1525 </dd> 1526 1527 <!-- OBJECT METHODS --> 1528 <dd style="display: none; "> 1529 <div></div> 1530 </dd> 1531 1532 <!-- OBJECT EVENT FIELDS --> 1533 <dd style="display: none; "> 1534 <div></div> 1535 </dd> 1536 1537 <!-- FUNCTION PARAMETERS --> 1538 <dd style="display: none; "> 1539 <div></div> 1540 </dd> 1541 1542 </div> 1543 </div> 1544 </dl> 1545 1546 <!-- RETURNS --> 1547 <h4 style="display: none; ">Returns</h4> 1548 <dl> 1549 <div style="display: none; "> 1550 <div> 1551 </div> 1552 </div> 1553 </dl> 1554 1555 <!-- CALLBACK --> 1556 <div> 1557 <div> 1558 <h4>Callback function</h4> 1559 <p style="display: none; "> 1560 The callback <em>parameter</em> should specify a function 1561 that looks like this: 1562 </p> 1563 <p> 1564 If you specify the <em>callback</em> parameter, it should 1565 specify a function that looks like this: 1566 </p> 1567 1568 <!-- Note: intentionally longer 80 columns --> 1569 <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre> 1570 <dl> 1571 <div style="display: none; "> 1572 <div> 1573 </div> 1574 </div> 1575 </dl> 1576 </div> 1577 </div> 1578 1579 <!-- MIN_VERSION --> 1580 <p style="display: none; "> 1581 This function was added in version <b><span></span></b>. 1582 If you require this function, the manifest key 1583 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1584 can ensure that your extension won't be run in an earlier browser version. 1585 </p> 1586 </div> <!-- /description --> 1587 1588 </div><div class="apiItem"> 1589 <a name="method-removeAll"></a> <!-- method-anchor --> 1590 <h4>removeAll</h4> 1591 1592 <div class="summary"><span style="display: none; ">void</span> 1593 <!-- Note: intentionally longer 80 columns --> 1594 <span>chrome.contextMenus.removeAll</span>(<span class="optional"><span style="display: none; ">, </span><span>function</span> 1595 <var><span>callback</span></var></span>)</div> 1596 1597 <div class="description"> 1598 <p class="todo" style="display: none; ">Undocumented.</p> 1599 <p>Remove all context menu items added by this extension.</p> 1600 1601 <!-- PARAMETERS --> 1602 <h4>Parameters</h4> 1603 <dl> 1604 <div> 1605 <div> 1606 <dt> 1607 <var>callback</var> 1608 <em> 1609 1610 <!-- TYPE --> 1611 <div style="display:inline"> 1612 ( 1613 <span class="optional">optional</span> 1614 <span class="enum" style="display: none; ">enumerated</span> 1615 <span id="typeTemplate"> 1616 <span style="display: none; "> 1617 <a> Type</a> 1618 </span> 1619 <span> 1620 <span style="display: none; "> 1621 array of <span><span></span></span> 1622 </span> 1623 <span>function</span> 1624 <span style="display: none; "></span> 1625 </span> 1626 </span> 1627 ) 1628 </div> 1629 1630 </em> 1631 </dt> 1632 <dd class="todo" style="display: none; "> 1633 Undocumented. 1634 </dd> 1635 <dd>Called when removal is complete.</dd> 1636 <dd style="display: none; "> 1637 This parameter was added in version 1638 <b><span></span></b>. 1639 You must omit this parameter in earlier versions, 1640 and you may omit it in any version. If you require this 1641 parameter, the manifest key 1642 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1643 can ensure that your extension won't be run in an earlier browser version. 1644 </dd> 1645 1646 <!-- OBJECT PROPERTIES --> 1647 <dd style="display: none; "> 1648 <dl> 1649 <div> 1650 <div> 1651 </div> 1652 </div> 1653 </dl> 1654 </dd> 1655 1656 <!-- OBJECT METHODS --> 1657 <dd style="display: none; "> 1658 <div></div> 1659 </dd> 1660 1661 <!-- OBJECT EVENT FIELDS --> 1662 <dd style="display: none; "> 1663 <div></div> 1664 </dd> 1665 1666 <!-- FUNCTION PARAMETERS --> 1667 <dd style="display: none; "> 1668 <div></div> 1669 </dd> 1670 1671 </div> 1672 </div> 1673 </dl> 1674 1675 <!-- RETURNS --> 1676 <h4 style="display: none; ">Returns</h4> 1677 <dl> 1678 <div style="display: none; "> 1679 <div> 1680 </div> 1681 </div> 1682 </dl> 1683 1684 <!-- CALLBACK --> 1685 <div> 1686 <div> 1687 <h4>Callback function</h4> 1688 <p style="display: none; "> 1689 The callback <em>parameter</em> should specify a function 1690 that looks like this: 1691 </p> 1692 <p> 1693 If you specify the <em>callback</em> parameter, it should 1694 specify a function that looks like this: 1695 </p> 1696 1697 <!-- Note: intentionally longer 80 columns --> 1698 <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre> 1699 <dl> 1700 <div style="display: none; "> 1701 <div> 1702 </div> 1703 </div> 1704 </dl> 1705 </div> 1706 </div> 1707 1708 <!-- MIN_VERSION --> 1709 <p style="display: none; "> 1710 This function was added in version <b><span></span></b>. 1711 If you require this function, the manifest key 1712 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1713 can ensure that your extension won't be run in an earlier browser version. 1714 </p> 1715 </div> <!-- /description --> 1716 1717 </div><div class="apiItem"> 1718 <a name="method-update"></a> <!-- method-anchor --> 1719 <h4>update</h4> 1720 1721 <div class="summary"><span style="display: none; ">void</span> 1722 <!-- Note: intentionally longer 80 columns --> 1723 <span>chrome.contextMenus.update</span>(<span class="null"><span style="display: none; ">, </span><span>integer</span> 1724 <var><span>id</span></var></span><span class="null"><span>, </span><span>object</span> 1725 <var><span>updateProperties</span></var></span><span class="optional"><span>, </span><span>function</span> 1726 <var><span>callback</span></var></span>)</div> 1727 1728 <div class="description"> 1729 <p class="todo" style="display: none; ">Undocumented.</p> 1730 <p>Update a previously created context menu item.</p> 1731 1732 <!-- PARAMETERS --> 1733 <h4>Parameters</h4> 1734 <dl> 1735 <div> 1736 <div> 1737 <dt> 1738 <var>id</var> 1739 <em> 1740 1741 <!-- TYPE --> 1742 <div style="display:inline"> 1743 ( 1744 <span class="optional" style="display: none; ">optional</span> 1745 <span class="enum" style="display: none; ">enumerated</span> 1746 <span id="typeTemplate"> 1747 <span style="display: none; "> 1748 <a> Type</a> 1749 </span> 1750 <span> 1751 <span style="display: none; "> 1752 array of <span><span></span></span> 1753 </span> 1754 <span>integer</span> 1755 <span style="display: none; "></span> 1756 </span> 1757 </span> 1758 ) 1759 </div> 1760 1761 </em> 1762 </dt> 1763 <dd class="todo" style="display: none; "> 1764 Undocumented. 1765 </dd> 1766 <dd>The ID of the item to update.</dd> 1767 <dd style="display: none; "> 1768 This parameter was added in version 1769 <b><span></span></b>. 1770 You must omit this parameter in earlier versions, 1771 and you may omit it in any version. If you require this 1772 parameter, the manifest key 1773 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1774 can ensure that your extension won't be run in an earlier browser version. 1775 </dd> 1776 1777 <!-- OBJECT PROPERTIES --> 1778 <dd style="display: none; "> 1779 <dl> 1780 <div> 1781 <div> 1782 </div> 1783 </div> 1784 </dl> 1785 </dd> 1786 1787 <!-- OBJECT METHODS --> 1788 <dd style="display: none; "> 1789 <div></div> 1790 </dd> 1791 1792 <!-- OBJECT EVENT FIELDS --> 1793 <dd style="display: none; "> 1794 <div></div> 1795 </dd> 1796 1797 <!-- FUNCTION PARAMETERS --> 1798 <dd style="display: none; "> 1799 <div></div> 1800 </dd> 1801 1802 </div> 1803 </div><div> 1804 <div> 1805 <dt> 1806 <var>updateProperties</var> 1807 <em> 1808 1809 <!-- TYPE --> 1810 <div style="display:inline"> 1811 ( 1812 <span class="optional" style="display: none; ">optional</span> 1813 <span class="enum" style="display: none; ">enumerated</span> 1814 <span id="typeTemplate"> 1815 <span style="display: none; "> 1816 <a> Type</a> 1817 </span> 1818 <span> 1819 <span style="display: none; "> 1820 array of <span><span></span></span> 1821 </span> 1822 <span>object</span> 1823 <span style="display: none; "></span> 1824 </span> 1825 </span> 1826 ) 1827 </div> 1828 1829 </em> 1830 </dt> 1831 <dd class="todo" style="display: none; "> 1832 Undocumented. 1833 </dd> 1834 <dd>The properties to update. Accepts the same values as the create function.</dd> 1835 <dd style="display: none; "> 1836 This parameter was added in version 1837 <b><span></span></b>. 1838 You must omit this parameter in earlier versions, 1839 and you may omit it in any version. If you require this 1840 parameter, the manifest key 1841 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1842 can ensure that your extension won't be run in an earlier browser version. 1843 </dd> 1844 1845 <!-- OBJECT PROPERTIES --> 1846 <dd> 1847 <dl> 1848 <div> 1849 <div> 1850 <dt> 1851 <var>type</var> 1852 <em> 1853 1854 <!-- TYPE --> 1855 <div style="display:inline"> 1856 ( 1857 <span class="optional">optional</span> 1858 <span class="enum">enumerated</span> 1859 <span id="typeTemplate"> 1860 <span style="display: none; "> 1861 <a> Type</a> 1862 </span> 1863 <span> 1864 <span style="display: none; "> 1865 array of <span><span></span></span> 1866 </span> 1867 <span>string</span> 1868 <span>["normal", "checkbox", "radio", "separator"]</span> 1869 </span> 1870 </span> 1871 ) 1872 </div> 1873 1874 </em> 1875 </dt> 1876 <dd class="todo"> 1877 Undocumented. 1878 </dd> 1879 <dd style="display: none; "> 1880 Description of this parameter from the json schema. 1881 </dd> 1882 <dd style="display: none; "> 1883 This parameter was added in version 1884 <b><span></span></b>. 1885 You must omit this parameter in earlier versions, 1886 and you may omit it in any version. If you require this 1887 parameter, the manifest key 1888 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1889 can ensure that your extension won't be run in an earlier browser version. 1890 </dd> 1891 1892 <!-- OBJECT PROPERTIES --> 1893 <dd style="display: none; "> 1894 <dl> 1895 <div> 1896 <div> 1897 </div> 1898 </div> 1899 </dl> 1900 </dd> 1901 1902 <!-- OBJECT METHODS --> 1903 <dd style="display: none; "> 1904 <div></div> 1905 </dd> 1906 1907 <!-- OBJECT EVENT FIELDS --> 1908 <dd style="display: none; "> 1909 <div></div> 1910 </dd> 1911 1912 <!-- FUNCTION PARAMETERS --> 1913 <dd style="display: none; "> 1914 <div></div> 1915 </dd> 1916 1917 </div> 1918 </div><div> 1919 <div> 1920 <dt> 1921 <var>title</var> 1922 <em> 1923 1924 <!-- TYPE --> 1925 <div style="display:inline"> 1926 ( 1927 <span class="optional">optional</span> 1928 <span class="enum" style="display: none; ">enumerated</span> 1929 <span id="typeTemplate"> 1930 <span style="display: none; "> 1931 <a> Type</a> 1932 </span> 1933 <span> 1934 <span style="display: none; "> 1935 array of <span><span></span></span> 1936 </span> 1937 <span>string</span> 1938 <span style="display: none; "></span> 1939 </span> 1940 </span> 1941 ) 1942 </div> 1943 1944 </em> 1945 </dt> 1946 <dd class="todo"> 1947 Undocumented. 1948 </dd> 1949 <dd style="display: none; "> 1950 Description of this parameter from the json schema. 1951 </dd> 1952 <dd style="display: none; "> 1953 This parameter was added in version 1954 <b><span></span></b>. 1955 You must omit this parameter in earlier versions, 1956 and you may omit it in any version. If you require this 1957 parameter, the manifest key 1958 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1959 can ensure that your extension won't be run in an earlier browser version. 1960 </dd> 1961 1962 <!-- OBJECT PROPERTIES --> 1963 <dd style="display: none; "> 1964 <dl> 1965 <div> 1966 <div> 1967 </div> 1968 </div> 1969 </dl> 1970 </dd> 1971 1972 <!-- OBJECT METHODS --> 1973 <dd style="display: none; "> 1974 <div></div> 1975 </dd> 1976 1977 <!-- OBJECT EVENT FIELDS --> 1978 <dd style="display: none; "> 1979 <div></div> 1980 </dd> 1981 1982 <!-- FUNCTION PARAMETERS --> 1983 <dd style="display: none; "> 1984 <div></div> 1985 </dd> 1986 1987 </div> 1988 </div><div> 1989 <div> 1990 <dt> 1991 <var>checked</var> 1992 <em> 1993 1994 <!-- TYPE --> 1995 <div style="display:inline"> 1996 ( 1997 <span class="optional">optional</span> 1998 <span class="enum" style="display: none; ">enumerated</span> 1999 <span id="typeTemplate"> 2000 <span style="display: none; "> 2001 <a> Type</a> 2002 </span> 2003 <span> 2004 <span style="display: none; "> 2005 array of <span><span></span></span> 2006 </span> 2007 <span>boolean</span> 2008 <span style="display: none; "></span> 2009 </span> 2010 </span> 2011 ) 2012 </div> 2013 2014 </em> 2015 </dt> 2016 <dd class="todo"> 2017 Undocumented. 2018 </dd> 2019 <dd style="display: none; "> 2020 Description of this parameter from the json schema. 2021 </dd> 2022 <dd style="display: none; "> 2023 This parameter was added in version 2024 <b><span></span></b>. 2025 You must omit this parameter in earlier versions, 2026 and you may omit it in any version. If you require this 2027 parameter, the manifest key 2028 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2029 can ensure that your extension won't be run in an earlier browser version. 2030 </dd> 2031 2032 <!-- OBJECT PROPERTIES --> 2033 <dd style="display: none; "> 2034 <dl> 2035 <div> 2036 <div> 2037 </div> 2038 </div> 2039 </dl> 2040 </dd> 2041 2042 <!-- OBJECT METHODS --> 2043 <dd style="display: none; "> 2044 <div></div> 2045 </dd> 2046 2047 <!-- OBJECT EVENT FIELDS --> 2048 <dd style="display: none; "> 2049 <div></div> 2050 </dd> 2051 2052 <!-- FUNCTION PARAMETERS --> 2053 <dd style="display: none; "> 2054 <div></div> 2055 </dd> 2056 2057 </div> 2058 </div><div> 2059 <div> 2060 <dt> 2061 <var>contexts</var> 2062 <em> 2063 2064 <!-- TYPE --> 2065 <div style="display:inline"> 2066 ( 2067 <span class="optional">optional</span> 2068 <span class="enum" style="display: none; ">enumerated</span> 2069 <span id="typeTemplate"> 2070 <span style="display: none; "> 2071 <a> Type</a> 2072 </span> 2073 <span> 2074 <span> 2075 array of <span><span> 2076 <span style="display: none; "> 2077 <a> Type</a> 2078 </span> 2079 <span> 2080 <span style="display: none; "> 2081 array of <span><span></span></span> 2082 </span> 2083 <span>string</span> 2084 <span>["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio"]</span> 2085 </span> 2086 </span></span> 2087 </span> 2088 <span style="display: none; ">paramType</span> 2089 <span style="display: none; "></span> 2090 </span> 2091 </span> 2092 ) 2093 </div> 2094 2095 </em> 2096 </dt> 2097 <dd class="todo"> 2098 Undocumented. 2099 </dd> 2100 <dd style="display: none; "> 2101 Description of this parameter from the json schema. 2102 </dd> 2103 <dd style="display: none; "> 2104 This parameter was added in version 2105 <b><span></span></b>. 2106 You must omit this parameter in earlier versions, 2107 and you may omit it in any version. If you require this 2108 parameter, the manifest key 2109 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2110 can ensure that your extension won't be run in an earlier browser version. 2111 </dd> 2112 2113 <!-- OBJECT PROPERTIES --> 2114 <dd style="display: none; "> 2115 <dl> 2116 <div> 2117 <div> 2118 </div> 2119 </div> 2120 </dl> 2121 </dd> 2122 2123 <!-- OBJECT METHODS --> 2124 <dd style="display: none; "> 2125 <div></div> 2126 </dd> 2127 2128 <!-- OBJECT EVENT FIELDS --> 2129 <dd style="display: none; "> 2130 <div></div> 2131 </dd> 2132 2133 <!-- FUNCTION PARAMETERS --> 2134 <dd style="display: none; "> 2135 <div></div> 2136 </dd> 2137 2138 </div> 2139 </div><div> 2140 <div> 2141 <dt> 2142 <var>onclick</var> 2143 <em> 2144 2145 <!-- TYPE --> 2146 <div style="display:inline"> 2147 ( 2148 <span class="optional">optional</span> 2149 <span class="enum" style="display: none; ">enumerated</span> 2150 <span id="typeTemplate"> 2151 <span style="display: none; "> 2152 <a> Type</a> 2153 </span> 2154 <span> 2155 <span style="display: none; "> 2156 array of <span><span></span></span> 2157 </span> 2158 <span>function</span> 2159 <span style="display: none; "></span> 2160 </span> 2161 </span> 2162 ) 2163 </div> 2164 2165 </em> 2166 </dt> 2167 <dd class="todo"> 2168 Undocumented. 2169 </dd> 2170 <dd style="display: none; "> 2171 Description of this parameter from the json schema. 2172 </dd> 2173 <dd style="display: none; "> 2174 This parameter was added in version 2175 <b><span></span></b>. 2176 You must omit this parameter in earlier versions, 2177 and you may omit it in any version. If you require this 2178 parameter, the manifest key 2179 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2180 can ensure that your extension won't be run in an earlier browser version. 2181 </dd> 2182 2183 <!-- OBJECT PROPERTIES --> 2184 <dd style="display: none; "> 2185 <dl> 2186 <div> 2187 <div> 2188 </div> 2189 </div> 2190 </dl> 2191 </dd> 2192 2193 <!-- OBJECT METHODS --> 2194 <dd style="display: none; "> 2195 <div></div> 2196 </dd> 2197 2198 <!-- OBJECT EVENT FIELDS --> 2199 <dd style="display: none; "> 2200 <div></div> 2201 </dd> 2202 2203 <!-- FUNCTION PARAMETERS --> 2204 <dd style="display: none; "> 2205 <div></div> 2206 </dd> 2207 2208 </div> 2209 </div><div> 2210 <div> 2211 <dt> 2212 <var>parentId</var> 2213 <em> 2214 2215 <!-- TYPE --> 2216 <div style="display:inline"> 2217 ( 2218 <span class="optional">optional</span> 2219 <span class="enum" style="display: none; ">enumerated</span> 2220 <span id="typeTemplate"> 2221 <span style="display: none; "> 2222 <a> Type</a> 2223 </span> 2224 <span> 2225 <span style="display: none; "> 2226 array of <span><span></span></span> 2227 </span> 2228 <span>integer</span> 2229 <span style="display: none; "></span> 2230 </span> 2231 </span> 2232 ) 2233 </div> 2234 2235 </em> 2236 </dt> 2237 <dd class="todo" style="display: none; "> 2238 Undocumented. 2239 </dd> 2240 <dd>Note: You cannot change an item to be a child of one of its own descendants.</dd> 2241 <dd style="display: none; "> 2242 This parameter was added in version 2243 <b><span></span></b>. 2244 You must omit this parameter in earlier versions, 2245 and you may omit it in any version. If you require this 2246 parameter, the manifest key 2247 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2248 can ensure that your extension won't be run in an earlier browser version. 2249 </dd> 2250 2251 <!-- OBJECT PROPERTIES --> 2252 <dd style="display: none; "> 2253 <dl> 2254 <div> 2255 <div> 2256 </div> 2257 </div> 2258 </dl> 2259 </dd> 2260 2261 <!-- OBJECT METHODS --> 2262 <dd style="display: none; "> 2263 <div></div> 2264 </dd> 2265 2266 <!-- OBJECT EVENT FIELDS --> 2267 <dd style="display: none; "> 2268 <div></div> 2269 </dd> 2270 2271 <!-- FUNCTION PARAMETERS --> 2272 <dd style="display: none; "> 2273 <div></div> 2274 </dd> 2275 2276 </div> 2277 </div><div> 2278 <div> 2279 <dt> 2280 <var>documentUrlPatterns</var> 2281 <em> 2282 2283 <!-- TYPE --> 2284 <div style="display:inline"> 2285 ( 2286 <span class="optional">optional</span> 2287 <span class="enum" style="display: none; ">enumerated</span> 2288 <span id="typeTemplate"> 2289 <span style="display: none; "> 2290 <a> Type</a> 2291 </span> 2292 <span> 2293 <span> 2294 array of <span><span> 2295 <span style="display: none; "> 2296 <a> Type</a> 2297 </span> 2298 <span> 2299 <span style="display: none; "> 2300 array of <span><span></span></span> 2301 </span> 2302 <span>string</span> 2303 <span style="display: none; "></span> 2304 </span> 2305 </span></span> 2306 </span> 2307 <span style="display: none; ">paramType</span> 2308 <span style="display: none; "></span> 2309 </span> 2310 </span> 2311 ) 2312 </div> 2313 2314 </em> 2315 </dt> 2316 <dd class="todo"> 2317 Undocumented. 2318 </dd> 2319 <dd style="display: none; "> 2320 Description of this parameter from the json schema. 2321 </dd> 2322 <dd style="display: none; "> 2323 This parameter was added in version 2324 <b><span></span></b>. 2325 You must omit this parameter in earlier versions, 2326 and you may omit it in any version. If you require this 2327 parameter, the manifest key 2328 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2329 can ensure that your extension won't be run in an earlier browser version. 2330 </dd> 2331 2332 <!-- OBJECT PROPERTIES --> 2333 <dd style="display: none; "> 2334 <dl> 2335 <div> 2336 <div> 2337 </div> 2338 </div> 2339 </dl> 2340 </dd> 2341 2342 <!-- OBJECT METHODS --> 2343 <dd style="display: none; "> 2344 <div></div> 2345 </dd> 2346 2347 <!-- OBJECT EVENT FIELDS --> 2348 <dd style="display: none; "> 2349 <div></div> 2350 </dd> 2351 2352 <!-- FUNCTION PARAMETERS --> 2353 <dd style="display: none; "> 2354 <div></div> 2355 </dd> 2356 2357 </div> 2358 </div><div> 2359 <div> 2360 <dt> 2361 <var>targetUrlPatterns</var> 2362 <em> 2363 2364 <!-- TYPE --> 2365 <div style="display:inline"> 2366 ( 2367 <span class="optional">optional</span> 2368 <span class="enum" style="display: none; ">enumerated</span> 2369 <span id="typeTemplate"> 2370 <span style="display: none; "> 2371 <a> Type</a> 2372 </span> 2373 <span> 2374 <span> 2375 array of <span><span> 2376 <span style="display: none; "> 2377 <a> Type</a> 2378 </span> 2379 <span> 2380 <span style="display: none; "> 2381 array of <span><span></span></span> 2382 </span> 2383 <span>string</span> 2384 <span style="display: none; "></span> 2385 </span> 2386 </span></span> 2387 </span> 2388 <span style="display: none; ">paramType</span> 2389 <span style="display: none; "></span> 2390 </span> 2391 </span> 2392 ) 2393 </div> 2394 2395 </em> 2396 </dt> 2397 <dd class="todo"> 2398 Undocumented. 2399 </dd> 2400 <dd style="display: none; "> 2401 Description of this parameter from the json schema. 2402 </dd> 2403 <dd style="display: none; "> 2404 This parameter was added in version 2405 <b><span></span></b>. 2406 You must omit this parameter in earlier versions, 2407 and you may omit it in any version. If you require this 2408 parameter, the manifest key 2409 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2410 can ensure that your extension won't be run in an earlier browser version. 2411 </dd> 2412 2413 <!-- OBJECT PROPERTIES --> 2414 <dd style="display: none; "> 2415 <dl> 2416 <div> 2417 <div> 2418 </div> 2419 </div> 2420 </dl> 2421 </dd> 2422 2423 <!-- OBJECT METHODS --> 2424 <dd style="display: none; "> 2425 <div></div> 2426 </dd> 2427 2428 <!-- OBJECT EVENT FIELDS --> 2429 <dd style="display: none; "> 2430 <div></div> 2431 </dd> 2432 2433 <!-- FUNCTION PARAMETERS --> 2434 <dd style="display: none; "> 2435 <div></div> 2436 </dd> 2437 2438 </div> 2439 </div> 2440 </dl> 2441 </dd> 2442 2443 <!-- OBJECT METHODS --> 2444 <dd style="display: none; "> 2445 <div></div> 2446 </dd> 2447 2448 <!-- OBJECT EVENT FIELDS --> 2449 <dd style="display: none; "> 2450 <div></div> 2451 </dd> 2452 2453 <!-- FUNCTION PARAMETERS --> 2454 <dd style="display: none; "> 2455 <div></div> 2456 </dd> 2457 2458 </div> 2459 </div><div> 2460 <div> 2461 <dt> 2462 <var>callback</var> 2463 <em> 2464 2465 <!-- TYPE --> 2466 <div style="display:inline"> 2467 ( 2468 <span class="optional">optional</span> 2469 <span class="enum" style="display: none; ">enumerated</span> 2470 <span id="typeTemplate"> 2471 <span style="display: none; "> 2472 <a> Type</a> 2473 </span> 2474 <span> 2475 <span style="display: none; "> 2476 array of <span><span></span></span> 2477 </span> 2478 <span>function</span> 2479 <span style="display: none; "></span> 2480 </span> 2481 </span> 2482 ) 2483 </div> 2484 2485 </em> 2486 </dt> 2487 <dd class="todo" style="display: none; "> 2488 Undocumented. 2489 </dd> 2490 <dd>Called when the context menu has been updated.</dd> 2491 <dd style="display: none; "> 2492 This parameter was added in version 2493 <b><span></span></b>. 2494 You must omit this parameter in earlier versions, 2495 and you may omit it in any version. If you require this 2496 parameter, the manifest key 2497 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2498 can ensure that your extension won't be run in an earlier browser version. 2499 </dd> 2500 2501 <!-- OBJECT PROPERTIES --> 2502 <dd style="display: none; "> 2503 <dl> 2504 <div> 2505 <div> 2506 </div> 2507 </div> 2508 </dl> 2509 </dd> 2510 2511 <!-- OBJECT METHODS --> 2512 <dd style="display: none; "> 2513 <div></div> 2514 </dd> 2515 2516 <!-- OBJECT EVENT FIELDS --> 2517 <dd style="display: none; "> 2518 <div></div> 2519 </dd> 2520 2521 <!-- FUNCTION PARAMETERS --> 2522 <dd style="display: none; "> 2523 <div></div> 2524 </dd> 2525 2526 </div> 2527 </div> 2528 </dl> 2529 2530 <!-- RETURNS --> 2531 <h4 style="display: none; ">Returns</h4> 2532 <dl> 2533 <div style="display: none; "> 2534 <div> 2535 </div> 2536 </div> 2537 </dl> 2538 2539 <!-- CALLBACK --> 2540 <div> 2541 <div> 2542 <h4>Callback function</h4> 2543 <p style="display: none; "> 2544 The callback <em>parameter</em> should specify a function 2545 that looks like this: 2546 </p> 2547 <p> 2548 If you specify the <em>callback</em> parameter, it should 2549 specify a function that looks like this: 2550 </p> 2551 2552 <!-- Note: intentionally longer 80 columns --> 2553 <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre> 2554 <dl> 2555 <div style="display: none; "> 2556 <div> 2557 </div> 2558 </div> 2559 </dl> 2560 </div> 2561 </div> 2562 2563 <!-- MIN_VERSION --> 2564 <p style="display: none; "> 2565 This function was added in version <b><span></span></b>. 2566 If you require this function, the manifest key 2567 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2568 can ensure that your extension won't be run in an earlier browser version. 2569 </p> 2570 </div> <!-- /description --> 2571 2572 </div> <!-- /apiItem --> 2573 2574 </div> <!-- /apiGroup --> 2575 2576 <!-- EVENTS --> 2577 <div id="eventsTemplate" class="apiGroup" style="display: none; "> 2578 <a></a> 2579 <h3>Events</h3> 2580 <!-- iterates over all events --> 2581 <div class="apiItem"> 2582 <a></a> 2583 <h4>event name</h4> 2584 2585 <div class="summary"> 2586 <!-- Note: intentionally longer 80 columns --> 2587 <span class="subdued">chrome.bookmarks</span><span>onEvent</span><span class="subdued">.addListener</span>(function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>); 2588 </div> 2589 2590 <div class="description"> 2591 <p class="todo">Undocumented.</p> 2592 <p> 2593 A description from the json schema def of the event goes here. 2594 </p> 2595 2596 <!-- PARAMETERS --> 2597 <div> 2598 <h4>Parameters</h4> 2599 <dl> 2600 <div> 2601 <div> 2602 </div> 2603 </div> 2604 </dl> 2605 </div> 2606 </div> <!-- /decription --> 2607 2608 </div> <!-- /apiItem --> 2609 2610 </div> <!-- /apiGroup --> 2611 2612 <!-- TYPES --> 2613 <div class="apiGroup"> 2614 <a name="types"></a> 2615 <h3 id="types">Types</h3> 2616 2617 <!-- iterates over all types --> 2618 <div class="apiItem"> 2619 <a name="type-OnClickData"></a> 2620 <h4>OnClickData</h4> 2621 2622 <div> 2623 <dt> 2624 <var style="display: none; ">paramName</var> 2625 <em> 2626 2627 <!-- TYPE --> 2628 <div style="display:inline"> 2629 ( 2630 <span class="optional" style="display: none; ">optional</span> 2631 <span class="enum" style="display: none; ">enumerated</span> 2632 <span id="typeTemplate"> 2633 <span style="display: none; "> 2634 <a> Type</a> 2635 </span> 2636 <span> 2637 <span style="display: none; "> 2638 array of <span><span></span></span> 2639 </span> 2640 <span>object</span> 2641 <span style="display: none; "></span> 2642 </span> 2643 </span> 2644 ) 2645 </div> 2646 2647 </em> 2648 </dt> 2649 <dd class="todo" style="display: none; "> 2650 Undocumented. 2651 </dd> 2652 <dd>Information sent when a context menu item is clicked.</dd> 2653 <dd style="display: none; "> 2654 This parameter was added in version 2655 <b><span></span></b>. 2656 You must omit this parameter in earlier versions, 2657 and you may omit it in any version. If you require this 2658 parameter, the manifest key 2659 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2660 can ensure that your extension won't be run in an earlier browser version. 2661 </dd> 2662 2663 <!-- OBJECT PROPERTIES --> 2664 <dd> 2665 <dl> 2666 <div> 2667 <div> 2668 <dt> 2669 <var>menuItemId</var> 2670 <em> 2671 2672 <!-- TYPE --> 2673 <div style="display:inline"> 2674 ( 2675 <span class="optional" style="display: none; ">optional</span> 2676 <span class="enum" style="display: none; ">enumerated</span> 2677 <span id="typeTemplate"> 2678 <span style="display: none; "> 2679 <a> Type</a> 2680 </span> 2681 <span> 2682 <span style="display: none; "> 2683 array of <span><span></span></span> 2684 </span> 2685 <span>integer</span> 2686 <span style="display: none; "></span> 2687 </span> 2688 </span> 2689 ) 2690 </div> 2691 2692 </em> 2693 </dt> 2694 <dd class="todo" style="display: none; "> 2695 Undocumented. 2696 </dd> 2697 <dd>The ID of the menu item that was clicked.</dd> 2698 <dd style="display: none; "> 2699 This parameter was added in version 2700 <b><span></span></b>. 2701 You must omit this parameter in earlier versions, 2702 and you may omit it in any version. If you require this 2703 parameter, the manifest key 2704 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2705 can ensure that your extension won't be run in an earlier browser version. 2706 </dd> 2707 2708 <!-- OBJECT PROPERTIES --> 2709 <dd style="display: none; "> 2710 <dl> 2711 <div> 2712 <div> 2713 </div> 2714 </div> 2715 </dl> 2716 </dd> 2717 2718 <!-- OBJECT METHODS --> 2719 <dd style="display: none; "> 2720 <div></div> 2721 </dd> 2722 2723 <!-- OBJECT EVENT FIELDS --> 2724 <dd style="display: none; "> 2725 <div></div> 2726 </dd> 2727 2728 <!-- FUNCTION PARAMETERS --> 2729 <dd style="display: none; "> 2730 <div></div> 2731 </dd> 2732 2733 </div> 2734 </div><div> 2735 <div> 2736 <dt> 2737 <var>parentMenuItemId</var> 2738 <em> 2739 2740 <!-- TYPE --> 2741 <div style="display:inline"> 2742 ( 2743 <span class="optional">optional</span> 2744 <span class="enum" style="display: none; ">enumerated</span> 2745 <span id="typeTemplate"> 2746 <span style="display: none; "> 2747 <a> Type</a> 2748 </span> 2749 <span> 2750 <span style="display: none; "> 2751 array of <span><span></span></span> 2752 </span> 2753 <span>integer</span> 2754 <span style="display: none; "></span> 2755 </span> 2756 </span> 2757 ) 2758 </div> 2759 2760 </em> 2761 </dt> 2762 <dd class="todo" style="display: none; "> 2763 Undocumented. 2764 </dd> 2765 <dd>The parent ID, if any, for the item clicked.</dd> 2766 <dd style="display: none; "> 2767 This parameter was added in version 2768 <b><span></span></b>. 2769 You must omit this parameter in earlier versions, 2770 and you may omit it in any version. If you require this 2771 parameter, the manifest key 2772 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2773 can ensure that your extension won't be run in an earlier browser version. 2774 </dd> 2775 2776 <!-- OBJECT PROPERTIES --> 2777 <dd style="display: none; "> 2778 <dl> 2779 <div> 2780 <div> 2781 </div> 2782 </div> 2783 </dl> 2784 </dd> 2785 2786 <!-- OBJECT METHODS --> 2787 <dd style="display: none; "> 2788 <div></div> 2789 </dd> 2790 2791 <!-- OBJECT EVENT FIELDS --> 2792 <dd style="display: none; "> 2793 <div></div> 2794 </dd> 2795 2796 <!-- FUNCTION PARAMETERS --> 2797 <dd style="display: none; "> 2798 <div></div> 2799 </dd> 2800 2801 </div> 2802 </div><div> 2803 <div> 2804 <dt> 2805 <var>mediaType</var> 2806 <em> 2807 2808 <!-- TYPE --> 2809 <div style="display:inline"> 2810 ( 2811 <span class="optional">optional</span> 2812 <span class="enum" style="display: none; ">enumerated</span> 2813 <span id="typeTemplate"> 2814 <span style="display: none; "> 2815 <a> Type</a> 2816 </span> 2817 <span> 2818 <span style="display: none; "> 2819 array of <span><span></span></span> 2820 </span> 2821 <span>string</span> 2822 <span style="display: none; "></span> 2823 </span> 2824 </span> 2825 ) 2826 </div> 2827 2828 </em> 2829 </dt> 2830 <dd class="todo" style="display: none; "> 2831 Undocumented. 2832 </dd> 2833 <dd>One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements.</dd> 2834 <dd style="display: none; "> 2835 This parameter was added in version 2836 <b><span></span></b>. 2837 You must omit this parameter in earlier versions, 2838 and you may omit it in any version. If you require this 2839 parameter, the manifest key 2840 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2841 can ensure that your extension won't be run in an earlier browser version. 2842 </dd> 2843 2844 <!-- OBJECT PROPERTIES --> 2845 <dd style="display: none; "> 2846 <dl> 2847 <div> 2848 <div> 2849 </div> 2850 </div> 2851 </dl> 2852 </dd> 2853 2854 <!-- OBJECT METHODS --> 2855 <dd style="display: none; "> 2856 <div></div> 2857 </dd> 2858 2859 <!-- OBJECT EVENT FIELDS --> 2860 <dd style="display: none; "> 2861 <div></div> 2862 </dd> 2863 2864 <!-- FUNCTION PARAMETERS --> 2865 <dd style="display: none; "> 2866 <div></div> 2867 </dd> 2868 2869 </div> 2870 </div><div> 2871 <div> 2872 <dt> 2873 <var>linkUrl</var> 2874 <em> 2875 2876 <!-- TYPE --> 2877 <div style="display:inline"> 2878 ( 2879 <span class="optional">optional</span> 2880 <span class="enum" style="display: none; ">enumerated</span> 2881 <span id="typeTemplate"> 2882 <span style="display: none; "> 2883 <a> Type</a> 2884 </span> 2885 <span> 2886 <span style="display: none; "> 2887 array of <span><span></span></span> 2888 </span> 2889 <span>string</span> 2890 <span style="display: none; "></span> 2891 </span> 2892 </span> 2893 ) 2894 </div> 2895 2896 </em> 2897 </dt> 2898 <dd class="todo" style="display: none; "> 2899 Undocumented. 2900 </dd> 2901 <dd>If the element is a link, the URL it points to.</dd> 2902 <dd style="display: none; "> 2903 This parameter was added in version 2904 <b><span></span></b>. 2905 You must omit this parameter in earlier versions, 2906 and you may omit it in any version. If you require this 2907 parameter, the manifest key 2908 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2909 can ensure that your extension won't be run in an earlier browser version. 2910 </dd> 2911 2912 <!-- OBJECT PROPERTIES --> 2913 <dd style="display: none; "> 2914 <dl> 2915 <div> 2916 <div> 2917 </div> 2918 </div> 2919 </dl> 2920 </dd> 2921 2922 <!-- OBJECT METHODS --> 2923 <dd style="display: none; "> 2924 <div></div> 2925 </dd> 2926 2927 <!-- OBJECT EVENT FIELDS --> 2928 <dd style="display: none; "> 2929 <div></div> 2930 </dd> 2931 2932 <!-- FUNCTION PARAMETERS --> 2933 <dd style="display: none; "> 2934 <div></div> 2935 </dd> 2936 2937 </div> 2938 </div><div> 2939 <div> 2940 <dt> 2941 <var>srcUrl</var> 2942 <em> 2943 2944 <!-- TYPE --> 2945 <div style="display:inline"> 2946 ( 2947 <span class="optional">optional</span> 2948 <span class="enum" style="display: none; ">enumerated</span> 2949 <span id="typeTemplate"> 2950 <span style="display: none; "> 2951 <a> Type</a> 2952 </span> 2953 <span> 2954 <span style="display: none; "> 2955 array of <span><span></span></span> 2956 </span> 2957 <span>string</span> 2958 <span style="display: none; "></span> 2959 </span> 2960 </span> 2961 ) 2962 </div> 2963 2964 </em> 2965 </dt> 2966 <dd class="todo" style="display: none; "> 2967 Undocumented. 2968 </dd> 2969 <dd>Will be present for elements with a 'src' URL.</dd> 2970 <dd style="display: none; "> 2971 This parameter was added in version 2972 <b><span></span></b>. 2973 You must omit this parameter in earlier versions, 2974 and you may omit it in any version. If you require this 2975 parameter, the manifest key 2976 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2977 can ensure that your extension won't be run in an earlier browser version. 2978 </dd> 2979 2980 <!-- OBJECT PROPERTIES --> 2981 <dd style="display: none; "> 2982 <dl> 2983 <div> 2984 <div> 2985 </div> 2986 </div> 2987 </dl> 2988 </dd> 2989 2990 <!-- OBJECT METHODS --> 2991 <dd style="display: none; "> 2992 <div></div> 2993 </dd> 2994 2995 <!-- OBJECT EVENT FIELDS --> 2996 <dd style="display: none; "> 2997 <div></div> 2998 </dd> 2999 3000 <!-- FUNCTION PARAMETERS --> 3001 <dd style="display: none; "> 3002 <div></div> 3003 </dd> 3004 3005 </div> 3006 </div><div> 3007 <div> 3008 <dt> 3009 <var>pageUrl</var> 3010 <em> 3011 3012 <!-- TYPE --> 3013 <div style="display:inline"> 3014 ( 3015 <span class="optional" style="display: none; ">optional</span> 3016 <span class="enum" style="display: none; ">enumerated</span> 3017 <span id="typeTemplate"> 3018 <span style="display: none; "> 3019 <a> Type</a> 3020 </span> 3021 <span> 3022 <span style="display: none; "> 3023 array of <span><span></span></span> 3024 </span> 3025 <span>string</span> 3026 <span style="display: none; "></span> 3027 </span> 3028 </span> 3029 ) 3030 </div> 3031 3032 </em> 3033 </dt> 3034 <dd class="todo" style="display: none; "> 3035 Undocumented. 3036 </dd> 3037 <dd>The URL of the page where the menu item was clicked.</dd> 3038 <dd style="display: none; "> 3039 This parameter was added in version 3040 <b><span></span></b>. 3041 You must omit this parameter in earlier versions, 3042 and you may omit it in any version. If you require this 3043 parameter, the manifest key 3044 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 3045 can ensure that your extension won't be run in an earlier browser version. 3046 </dd> 3047 3048 <!-- OBJECT PROPERTIES --> 3049 <dd style="display: none; "> 3050 <dl> 3051 <div> 3052 <div> 3053 </div> 3054 </div> 3055 </dl> 3056 </dd> 3057 3058 <!-- OBJECT METHODS --> 3059 <dd style="display: none; "> 3060 <div></div> 3061 </dd> 3062 3063 <!-- OBJECT EVENT FIELDS --> 3064 <dd style="display: none; "> 3065 <div></div> 3066 </dd> 3067 3068 <!-- FUNCTION PARAMETERS --> 3069 <dd style="display: none; "> 3070 <div></div> 3071 </dd> 3072 3073 </div> 3074 </div><div> 3075 <div> 3076 <dt> 3077 <var>frameUrl</var> 3078 <em> 3079 3080 <!-- TYPE --> 3081 <div style="display:inline"> 3082 ( 3083 <span class="optional">optional</span> 3084 <span class="enum" style="display: none; ">enumerated</span> 3085 <span id="typeTemplate"> 3086 <span style="display: none; "> 3087 <a> Type</a> 3088 </span> 3089 <span> 3090 <span style="display: none; "> 3091 array of <span><span></span></span> 3092 </span> 3093 <span>string</span> 3094 <span style="display: none; "></span> 3095 </span> 3096 </span> 3097 ) 3098 </div> 3099 3100 </em> 3101 </dt> 3102 <dd class="todo" style="display: none; "> 3103 Undocumented. 3104 </dd> 3105 <dd> The URL of the frame of the element where the context menu was clicked, if it was in a frame.</dd> 3106 <dd style="display: none; "> 3107 This parameter was added in version 3108 <b><span></span></b>. 3109 You must omit this parameter in earlier versions, 3110 and you may omit it in any version. If you require this 3111 parameter, the manifest key 3112 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 3113 can ensure that your extension won't be run in an earlier browser version. 3114 </dd> 3115 3116 <!-- OBJECT PROPERTIES --> 3117 <dd style="display: none; "> 3118 <dl> 3119 <div> 3120 <div> 3121 </div> 3122 </div> 3123 </dl> 3124 </dd> 3125 3126 <!-- OBJECT METHODS --> 3127 <dd style="display: none; "> 3128 <div></div> 3129 </dd> 3130 3131 <!-- OBJECT EVENT FIELDS --> 3132 <dd style="display: none; "> 3133 <div></div> 3134 </dd> 3135 3136 <!-- FUNCTION PARAMETERS --> 3137 <dd style="display: none; "> 3138 <div></div> 3139 </dd> 3140 3141 </div> 3142 </div><div> 3143 <div> 3144 <dt> 3145 <var>selectionText</var> 3146 <em> 3147 3148 <!-- TYPE --> 3149 <div style="display:inline"> 3150 ( 3151 <span class="optional">optional</span> 3152 <span class="enum" style="display: none; ">enumerated</span> 3153 <span id="typeTemplate"> 3154 <span style="display: none; "> 3155 <a> Type</a> 3156 </span> 3157 <span> 3158 <span style="display: none; "> 3159 array of <span><span></span></span> 3160 </span> 3161 <span>string</span> 3162 <span style="display: none; "></span> 3163 </span> 3164 </span> 3165 ) 3166 </div> 3167 3168 </em> 3169 </dt> 3170 <dd class="todo" style="display: none; "> 3171 Undocumented. 3172 </dd> 3173 <dd>The text for the context selection, if any.</dd> 3174 <dd style="display: none; "> 3175 This parameter was added in version 3176 <b><span></span></b>. 3177 You must omit this parameter in earlier versions, 3178 and you may omit it in any version. If you require this 3179 parameter, the manifest key 3180 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 3181 can ensure that your extension won't be run in an earlier browser version. 3182 </dd> 3183 3184 <!-- OBJECT PROPERTIES --> 3185 <dd style="display: none; "> 3186 <dl> 3187 <div> 3188 <div> 3189 </div> 3190 </div> 3191 </dl> 3192 </dd> 3193 3194 <!-- OBJECT METHODS --> 3195 <dd style="display: none; "> 3196 <div></div> 3197 </dd> 3198 3199 <!-- OBJECT EVENT FIELDS --> 3200 <dd style="display: none; "> 3201 <div></div> 3202 </dd> 3203 3204 <!-- FUNCTION PARAMETERS --> 3205 <dd style="display: none; "> 3206 <div></div> 3207 </dd> 3208 3209 </div> 3210 </div><div> 3211 <div> 3212 <dt> 3213 <var>editable</var> 3214 <em> 3215 3216 <!-- TYPE --> 3217 <div style="display:inline"> 3218 ( 3219 <span class="optional" style="display: none; ">optional</span> 3220 <span class="enum" style="display: none; ">enumerated</span> 3221 <span id="typeTemplate"> 3222 <span style="display: none; "> 3223 <a> Type</a> 3224 </span> 3225 <span> 3226 <span style="display: none; "> 3227 array of <span><span></span></span> 3228 </span> 3229 <span>string</span> 3230 <span style="display: none; "></span> 3231 </span> 3232 </span> 3233 ) 3234 </div> 3235 3236 </em> 3237 </dt> 3238 <dd class="todo" style="display: none; "> 3239 Undocumented. 3240 </dd> 3241 <dd>A flag indicating whether the element is editable (text input, textarea, etc.).</dd> 3242 <dd style="display: none; "> 3243 This parameter was added in version 3244 <b><span></span></b>. 3245 You must omit this parameter in earlier versions, 3246 and you may omit it in any version. If you require this 3247 parameter, the manifest key 3248 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 3249 can ensure that your extension won't be run in an earlier browser version. 3250 </dd> 3251 3252 <!-- OBJECT PROPERTIES --> 3253 <dd style="display: none; "> 3254 <dl> 3255 <div> 3256 <div> 3257 </div> 3258 </div> 3259 </dl> 3260 </dd> 3261 3262 <!-- OBJECT METHODS --> 3263 <dd style="display: none; "> 3264 <div></div> 3265 </dd> 3266 3267 <!-- OBJECT EVENT FIELDS --> 3268 <dd style="display: none; "> 3269 <div></div> 3270 </dd> 3271 3272 <!-- FUNCTION PARAMETERS --> 3273 <dd style="display: none; "> 3274 <div></div> 3275 </dd> 3276 3277 </div> 3278 </div> 3279 </dl> 3280 </dd> 3281 3282 <!-- OBJECT METHODS --> 3283 <dd style="display: none; "> 3284 <div></div> 3285 </dd> 3286 3287 <!-- OBJECT EVENT FIELDS --> 3288 <dd style="display: none; "> 3289 <div></div> 3290 </dd> 3291 3292 <!-- FUNCTION PARAMETERS --> 3293 <dd style="display: none; "> 3294 <div></div> 3295 </dd> 3296 3297 </div> 3298 3299 </div> <!-- /apiItem --> 3300 3301 </div> <!-- /apiGroup --> 3302 3303 </div> <!-- /apiPage --> 3304 </div> <!-- /gc-pagecontent --> 3305 </div> <!-- /g-section --> 3306 </div> <!-- /codesiteContent --> 3307 <div id="gc-footer" --=""> 3308 <div class="text"> 3309 <p> 3310 Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>, 3311 the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons 3312 Attribution 3.0 License</a>, and code samples are licensed under the 3313 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>. 3314 </p> 3315 <p> 3316 2011 Google 3317 </p> 3318 3319 <!-- begin analytics --> 3320 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> 3321 <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script> 3322 3323 <script type="text/javascript"> 3324 // chrome doc tracking 3325 try { 3326 var engdocs = _gat._getTracker("YT-10763712-2"); 3327 engdocs._trackPageview(); 3328 } catch(err) {} 3329 3330 // code.google.com site-wide tracking 3331 try { 3332 _uacct="UA-18071-1"; 3333 _uanchor=1; 3334 _uff=0; 3335 urchinTracker(); 3336 } 3337 catch(e) {/* urchinTracker not available. */} 3338 </script> 3339 <!-- end analytics --> 3340 </div> 3341 </div> <!-- /gc-footer --> 3342 </div> <!-- /gc-container --> 3343 </body></html> 3344