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>Permission Warnings - 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><a href="contextMenus.html">Context Menus</a></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 class="leftNavSelected">Permission Warnings</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">Permission Warnings</h1> 255 </div> 256 <!-- TABLE OF CONTENTS --> 257 <div id="toc"> 258 <h2>Contents</h2> 259 <ol> 260 <li> 261 <a href="#examples"> Examples of permission warnings </a> 262 <ol> 263 <li style="display: none; "> 264 <a>h3Name</a> 265 </li> 266 </ol> 267 </li><li> 268 <a href="#warnings"> Warnings and their triggers </a> 269 <ol> 270 <li style="display: none; "> 271 <a>h3Name</a> 272 </li> 273 </ol> 274 </li><li> 275 <a href="#nowarning"> Permissions that don't cause warnings </a> 276 <ol> 277 <li style="display: none; "> 278 <a>h3Name</a> 279 </li> 280 </ol> 281 </li><li> 282 <a href="#test"> Testing permission warnings </a> 283 <ol> 284 <li style="display: none; "> 285 <a>h3Name</a> 286 </li> 287 </ol> 288 </li> 289 <li style="display: none; "> 290 <a href="#apiReference">API reference</a> 291 <ol> 292 <li> 293 <a href="#properties">Properties</a> 294 <ol> 295 <li> 296 <a href="#property-anchor">propertyName</a> 297 </li> 298 </ol> 299 </li> 300 <li> 301 <a>Methods</a> 302 <ol> 303 <li> 304 <a href="#method-anchor">methodName</a> 305 </li> 306 </ol> 307 </li> 308 <li> 309 <a>Events</a> 310 <ol> 311 <li> 312 <a href="#event-anchor">eventName</a> 313 </li> 314 </ol> 315 </li> 316 <li> 317 <a href="#types">Types</a> 318 <ol> 319 <li> 320 <a href="#id-anchor">id</a> 321 </li> 322 </ol> 323 </li> 324 </ol> 325 </li> 326 </ol> 327 </div> 328 <!-- /TABLE OF CONTENTS --> 329 330 <!-- Standard content lead-in for experimental API pages --> 331 <p id="classSummary" style="display: none; "> 332 For information on how to use experimental APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page. 333 </p> 334 335 <!-- STATIC CONTENT PLACEHOLDER --> 336 <div id="static"><div id="pageData-name" class="pageData">Permission Warnings</div> 337 <div id="pageData-showTOC" class="pageData">true</div> 338 339 <!-- 340 NOTE: When this doc is updated, the online help should also be updated: 341 http://www.google.com/support/chrome_webstore/bin/answer.py?hl=en&answer=186213 342 343 We should periodically look at 344 http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/generated_resources.grd?view=markup 345 to make sure that we're covering all messages. Search for 346 IDS_EXTENSION_PROMPT_WARNING 347 (e.g. IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY). 348 --> 349 350 <p> 351 To use most chrome.* APIs and extension capabilities, 352 your extension must declare its intent in the 353 <a href="manifest.html">manifest</a>, 354 often in the "permissions" field. 355 Some of these declarations 356 result in a warning when 357 a user installs your extension. 358 </p> 359 360 <p> 361 When you autoupdate your extension, 362 the user might see another warning 363 if the extension requests new permissions. 364 These new permissions might be new APIs that your extension uses, 365 or they might be new websites 366 that your extension needs access to. 367 </p> 368 369 370 <h2 id="examples"> Examples of permission warnings </h2> 371 372 <p> 373 Here's a typical dialog 374 that a user might see when installing an extension: 375 </p> 376 377 <img src="images/perms-hw1.png" width="410" height="193" alt="Permission warning: 'It can access: Your data on api.flickr.com'"> 378 379 <p> 380 The warning about access to data on api.flickr.com 381 is caused by the following lines 382 in the extension's manifest: 383 </p> 384 385 <pre>"permissions": [ 386 <b>"http://api.flickr.com/"</b> 387 ], 388 </pre> 389 390 <p class="note"> 391 <b>Note:</b> 392 You don't see permission warnings when 393 you load an unpacked extension. 394 You get permission warnings only when you install an extension 395 from a <code>.crx</code> file. 396 </p> 397 398 <p> 399 If you add a permission to the extension when you autoupdate it, 400 the user might see a new permission warning. 401 For example, 402 assume you add a new site and the "tabs" permission 403 to the previous example: 404 </p> 405 406 <pre>"permissions": [ 407 "http://api.flickr.com/", 408 <b>"http://*.flickr.com/", 409 "tabs"</b> 410 ], 411 </pre> 412 413 <p> 414 When the extension autoupdates, 415 the increased permissions 416 cause the extension to be disabled 417 until the user re-enables it. 418 Here's the warning the user sees: 419 </p> 420 421 <img src="images/perms-hw2-disabled.png" width="814" height="30" alt="Warning text: 'The newest version of the extension Hello World requires more permissions, so it has been disabled. [Re-enable].'"> 422 423 <p> 424 Clicking the Re-enable button 425 brings up the following warning: 426 </p> 427 428 <img src="images/perms-hw2.png" width="412" height="220" alt="Permission warning: 'It can access: Your data on api.flickr.com and flickr.com; Your browsing history'"> 429 430 431 <h2 id="warnings"> Warnings and their triggers </h2> 432 433 <p> 434 It can be surprising when adding a permission such as "tabs" 435 results in the seemingly unrelated warning 436 that the extension can access your browsing activity. 437 The reason for the warning is that 438 although the <code>chrome.tabs</code> API 439 might be used only to open new tabs, 440 it can also be used to see the URL that's associated 441 with every newly opened tab 442 (using their <a href="tabs.html#type-Tab">Tab</a> objects). 443 </p> 444 445 <p class="note"> 446 <b>Note:</b> 447 As of Google Chrome 7, 448 you no longer need to specify the "tabs" permission 449 just to call <code>chrome.tabs.create()</code> 450 or <code>chrome.tabs.update()</code>. 451 </p> 452 453 <p> 454 The following table lists the warning messages 455 that users can see, 456 along with the manifest entries 457 that trigger them. 458 </p> 459 460 <p> 461 </p><table> 462 <tbody><tr> 463 <th>Warning message</th> <th>Manifest entry that causes it</th> <th>Notes</th> 464 </tr> 465 466 <tr> 467 <td style="font-weight:bold"> 468 <!-- IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS --> 469 All data on your computer and the websites you visit 470 </td> 471 <td> 472 "plugins" 473 </td> 474 <td> 475 The "plugins" permission is required by 476 <a href="npapi.html">NPAPI plugins</a>. 477 </td> 478 </tr> 479 480 <tr> 481 <td style="font-weight:bold"> 482 <!-- IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS --> 483 Your bookmarks 484 </td> 485 <td> 486 "bookmarks" permission 487 </td> 488 <td> 489 The "bookmarks" permission is required by the 490 <a href="bookmarks.html"><code>chrome.bookmarks</code></a> module. 491 </td> 492 </tr> 493 494 <tr> 495 <td style="font-weight:bold"> 496 <!-- IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY --> 497 Your browsing history 498 </td> 499 <td> 500 <!-- HasEffectiveBrowsingHistoryPermission --> 501 "history" permission 502 </td> 503 <td> 504 <p> 505 The "history" permission is required by 506 <a href="history.html"><code>chrome.history</code></a>. 507 </p> 508 </td> 509 </tr> 510 511 <tr> 512 <td style="font-weight:bold"> 513 <!-- IDS_EXTENSION_PROMPT_WARNING_TABS --> 514 Your tabs and browsing activity 515 </td> 516 <td> 517 <!-- HasEffectiveBrowsingHistoryPermission --> 518 "tabs" permission 519 </td> 520 <td> 521 <p> 522 The "tabs" permission is required by the 523 <a href="tabs.html"><code>chrome.tabs</code></a> and 524 <a href="windows.html"><code>chrome.windows</code></a> modules. 525 </p> 526 </td> 527 </tr> 528 529 <tr> 530 <td style="font-weight:bold"> 531 <!-- IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS --> 532 Your data on all websites 533 </td> 534 <td> 535 <!-- HasEffectiveAccessToAllHosts() --> 536 Any of the following: 537 <ul> 538 <li> "proxy" permission </li> 539 <li> "debugger" permission </li> 540 <li> A match pattern in the "permissions" field 541 that matches all hosts </li> 542 <li> A "content_scripts" field with a "matches" entry 543 that matches all hosts </li> 544 <li> "devtools_page" (experimental) </li> 545 </ul> 546 </td> 547 <td> 548 <p> 549 The "proxy" permission is required by the 550 <a href="experimental.proxy.html">experimental proxy</a> module. 551 </p> 552 553 <p> 554 The "debugger" permission is required by the 555 <a href="experimental.debugger.html">experimental debugger</a> module. 556 </p> 557 558 <p> 559 Any of the following URLs match all hosts: 560 </p> 561 <ul> 562 <li> <code>http://*/*</code> </li> 563 <li> <code>https://*/*</code> </li> 564 <li> <code>*://*/*</code> </li> 565 <li> <code><all_urls></code> </li> 566 </ul> 567 </td> 568 </tr> 569 <tr> 570 <td style="font-weight:bold"> 571 <!-- IDS_EXTENSION_PROMPT_WARNING_?_HOST --> 572 <!-- IDS_EXTENSION_PROMPT_WARNING_4_OR_MORE_HOSTS --> 573 Your data on <em>{list of websites}</em> 574 </td> 575 <td> 576 A match pattern in the "permissions" field 577 that specifies one or more hosts, 578 but not all hosts 579 </td> 580 <td> 581 <p> 582 Up to 3 sites are listed by name. 583 Subdomains aren't treated specially. 584 For example, <code>a.com</code> and <code>b.a.com</code> 585 are listed as different sites. 586 </p> 587 588 <p> 589 On autoupdate, 590 the user sees a permission warning 591 if the extension adds or changes sites. 592 For example, going from <code>a.com,b.com</code> 593 to <code>a.com,b.com,c.com</code> 594 triggers a warning. 595 Going from <code>b.a.com</code> 596 to <code>a.com</code>, 597 or vice versa, 598 also triggers a warning. 599 </p> 600 </td> 601 </tr> 602 603 <tr> 604 <td style="font-weight:bold"> 605 <!-- IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT --> 606 Your list of installed apps, extensions, and themes 607 <br> 608 <span style="font-weight:normal; font-style:italic">or</span> 609 <br> 610 Manage themes, extensions, and apps 611 612 <!-- PENDING: remove "Manage...apps" alternative message 613 once the fix is out on stable channel --> 614 <!-- See http://crbug.com/67859 --> 615 </td> 616 <td> 617 "management" permission 618 </td> 619 <td> 620 The "management" permission is required by the 621 <a href="management.html"><code>chrome.management</code></a> module. 622 </td> 623 </tr> 624 625 <tr> 626 <td style="font-weight:bold"> 627 <!-- IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION --> 628 Your physical location 629 </td> 630 <td> 631 "geolocation" permission 632 </td> 633 <td> 634 Allows the extension to use the proposed HTML5 635 <a href="http://dev.w3.org/geo/api/spec-source.html">geolocation API</a> 636 without prompting the user for permission. 637 </td> 638 </tr> 639 </tbody></table> 640 <p></p> 641 642 643 <h2 id="nowarning"> Permissions that don't cause warnings </h2> 644 645 <p> 646 The following permissions don't result in a warning: 647 </p> 648 649 <ul> 650 <li>"chrome://favicon/"</li> 651 <li>"contextMenus"</li> 652 <li>"cookies"</li> 653 <li>"experimental"</li> 654 <li>"idle"</li> 655 <li>"notifications"</li> 656 <li>"unlimitedStorage"</li> 657 </ul> 658 659 <h2 id="test"> Testing permission warnings </h2> 660 661 <p> 662 If you'd like to see exactly which warnings your users will get, 663 <a href="packaging.html">package your extension</a> 664 into a <code>.crx</code> file, 665 and install it. 666 </p> 667 668 <p> 669 To see the warnings users will get when your extension is autoupdated, 670 you can go to a little more trouble 671 and set up an autoupdate server. 672 To do this, first create an update manifest 673 and point to it from your extension, 674 using the "update_url" key 675 (see <a href="autoupdate.html">Autoupdating</a>). 676 Next, <a href="packaging.html">package the extension</a> 677 into a new <code>.crx</code> file, 678 and install the app from this <code>.crx</code> file. 679 Now, change the extension's manifest to contain the new permissions, 680 and <a href="packaging.html#update">repackage the extension</a>. 681 Finally, update the extension 682 (and all other extensions that have outstanding updates) 683 by clicking the <b>chrome://extensions</b> page's 684 <b>Update extensions now</b> button. 685 </p> 686 </div> 687 688 <!-- API PAGE --> 689 <div class="apiPage" style="display: none; "> 690 <a name="apiReference"></a> 691 <h2>API reference: chrome.apiname </h2> 692 693 <!-- PROPERTIES --> 694 <div class="apiGroup"> 695 <a name="properties"></a> 696 <h3 id="properties">Properties</h3> 697 698 <div> 699 <a></a> 700 <h4>getLastError</h4> 701 <div class="summary"> 702 <!-- Note: intentionally longer 80 columns --> 703 <span>chrome.extension</span><span>lastError</span> 704 </div> 705 <div> 706 </div> 707 </div> 708 709 </div> <!-- /apiGroup --> 710 711 <!-- METHODS --> 712 <div id="methodsTemplate" class="apiGroup"> 713 <a></a> 714 <h3>Methods</h3> 715 716 <!-- iterates over all functions --> 717 <div class="apiItem"> 718 <a></a> <!-- method-anchor --> 719 <h4>method name</h4> 720 721 <div class="summary"><span>void</span> 722 <!-- Note: intentionally longer 80 columns --> 723 <span>chrome.module.methodName</span>(<span><span>, </span><span></span> 724 <var><span></span></var></span>)</div> 725 726 <div class="description"> 727 <p class="todo">Undocumented.</p> 728 <p> 729 A description from the json schema def of the function goes here. 730 </p> 731 732 <!-- PARAMETERS --> 733 <h4>Parameters</h4> 734 <dl> 735 <div> 736 <div> 737 </div> 738 </div> 739 </dl> 740 741 <!-- RETURNS --> 742 <h4>Returns</h4> 743 <dl> 744 <div> 745 <div> 746 </div> 747 </div> 748 </dl> 749 750 <!-- CALLBACK --> 751 <div> 752 <div> 753 <h4>Callback function</h4> 754 <p> 755 The callback <em>parameter</em> should specify a function 756 that looks like this: 757 </p> 758 <p> 759 If you specify the <em>callback</em> parameter, it should 760 specify a function that looks like this: 761 </p> 762 763 <!-- Note: intentionally longer 80 columns --> 764 <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre> 765 <dl> 766 <div> 767 <div> 768 </div> 769 </div> 770 </dl> 771 </div> 772 </div> 773 774 <!-- MIN_VERSION --> 775 <p> 776 This function was added in version <b><span></span></b>. 777 If you require this function, the manifest key 778 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 779 can ensure that your extension won't be run in an earlier browser version. 780 </p> 781 </div> <!-- /description --> 782 783 </div> <!-- /apiItem --> 784 785 </div> <!-- /apiGroup --> 786 787 <!-- EVENTS --> 788 <div id="eventsTemplate" class="apiGroup"> 789 <a></a> 790 <h3>Events</h3> 791 <!-- iterates over all events --> 792 <div class="apiItem"> 793 <a></a> 794 <h4>event name</h4> 795 796 <div class="summary"> 797 <!-- Note: intentionally longer 80 columns --> 798 <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>); 799 </div> 800 801 <div class="description"> 802 <p class="todo">Undocumented.</p> 803 <p> 804 A description from the json schema def of the event goes here. 805 </p> 806 807 <!-- PARAMETERS --> 808 <div> 809 <h4>Parameters</h4> 810 <dl> 811 <div> 812 <div> 813 </div> 814 </div> 815 </dl> 816 </div> 817 </div> <!-- /decription --> 818 819 </div> <!-- /apiItem --> 820 821 </div> <!-- /apiGroup --> 822 823 <!-- TYPES --> 824 <div class="apiGroup"> 825 <a name="types"></a> 826 <h3 id="types">Types</h3> 827 828 <!-- iterates over all types --> 829 <div class="apiItem"> 830 <a></a> 831 <h4>type name</h4> 832 833 <div> 834 </div> 835 836 </div> <!-- /apiItem --> 837 838 </div> <!-- /apiGroup --> 839 840 </div> <!-- /apiPage --> 841 </div> <!-- /gc-pagecontent --> 842 </div> <!-- /g-section --> 843 </div> <!-- /codesiteContent --> 844 <div id="gc-footer" --=""> 845 <div class="text"> 846 <p> 847 Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>, 848 the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons 849 Attribution 3.0 License</a>, and code samples are licensed under the 850 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>. 851 </p> 852 <p> 853 2011 Google 854 </p> 855 856 <!-- begin analytics --> 857 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> 858 <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script> 859 860 <script type="text/javascript"> 861 // chrome doc tracking 862 try { 863 var engdocs = _gat._getTracker("YT-10763712-2"); 864 engdocs._trackPageview(); 865 } catch(err) {} 866 867 // code.google.com site-wide tracking 868 try { 869 _uacct="UA-18071-1"; 870 _uanchor=1; 871 _uff=0; 872 urchinTracker(); 873 } 874 catch(e) {/* urchinTracker not available. */} 875 </script> 876 <!-- end analytics --> 877 </div> 878 </div> <!-- /gc-footer --> 879 </div> <!-- /gc-container --> 880 </body></html> 881