index.html revision ac1e49eb6695f711d72215fcdf9388548942a00d
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>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          <!-- FUNCTION PARAMETERS -->
85          <dd>
86            <div></div>
87          </dd>
88
89        </div> <!-- /VALUE -->
90
91        <div id="functionParametersTemplate">
92          <h5>Parameters</h5>
93          <dl>
94            <div>
95              <div>
96              </div>
97            </div>
98          </dl>
99        </div>
100      </div> <!-- /SUBTEMPLATES -->
101
102  <a id="top"></a>
103    <div id="skipto">
104      <a href="#gc-pagecontent">Skip to page content</a>
105      <a href="#gc-toc">Skip to main navigation</a>
106    </div>
107    <!-- API HEADER -->
108    <table id="header" width="100%" cellspacing="0" border="0">
109      <tbody><tr>
110        <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>
111        <td valign="middle" width="100%" style="padding-left:0.6em;">
112          <form action="http://www.google.com/cse" id="cse" style="margin-top:0.5em">
113            <div id="gsc-search-box">
114              <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno">
115              <input type="hidden" name="ie" value="UTF-8">
116              <input type="text" name="q" value="" size="55">
117              <input class="gsc-search-button" type="submit" name="sa" value="Search">
118              <br>
119              <span class="greytext">e.g. "page action" or "tabs"</span>
120            </div>
121          </form>
122
123          <script type="text/javascript" src="http://www.google.com/jsapi"></script>
124          <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
125          <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse&t13n_langs=en"></script>
126          <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse&lang=en"></script>
127        </td>
128      </tr>
129    </tbody></table>
130
131    <div id="codesiteContent" class="hideSideNav">
132
133      <a id="gc-topnav-anchor"></a>
134      <div id="gc-topnav">
135        <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Labs</a>)</h1>
136        <ul id="home" class="gc-topnav-tabs">
137          <li id="home_link">
138            <a href="index.html" title="Google Chrome Extensions home page">Home</a>
139          </li>
140          <li id="docs_link">
141            <a href="docs.html" title="Official Google Chrome Extensions documentation">Docs</a>
142          </li>
143          <li id="faq_link">
144            <a href="faq.html" title="Answers to frequently asked questions about Google Chrome Extensions">FAQ</a>
145          </li>
146          <li id="samples_link">
147            <a href="samples.html" title="Sample extensions (with source code)">Samples</a>
148          </li>
149          <li id="group_link">
150            <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions" title="Google Chrome Extensions developer forum">Group</a>
151          </li>
152        </ul>
153      </div> <!-- end gc-topnav -->
154
155    <div class="g-section g-tpl-170">
156      <!-- SIDENAV -->
157      <div class="g-unit g-first" id="gc-toc" style="display: none; ">
158        <ul>
159          <li><a href="getstarted.html">Getting Started</a></li>
160          <li><a href="overview.html">Overview</a></li>
161          <li><a href="whats_new.html">What's New?</a></li>
162          <li><h2><a href="devguide.html">Developer's Guide</a></h2>
163            <ul>
164              <li>Browser UI
165                <ul>
166                  <li><a href="browserAction.html">Browser Actions</a></li>
167                  <li><a href="contextMenus.html">Context Menus</a></li>
168                  <li><a href="notifications.html">Desktop Notifications</a></li>
169                  <li><a href="omnibox.html">Omnibox</a></li>
170                  <li><a href="options.html">Options Pages</a></li>
171                  <li><a href="override.html">Override Pages</a></li>
172                  <li><a href="pageAction.html">Page Actions</a></li>
173                </ul>
174              </li>
175              <li>Browser Interaction
176                <ul>
177                  <li><a href="bookmarks.html">Bookmarks</a></li>
178                  <li><a href="cookies.html">Cookies</a></li>
179                  <li><a href="events.html">Events</a></li>
180                  <li><a href="history.html">History</a></li>
181                  <li><a href="management.html">Management</a></li>
182                  <li><a href="tabs.html">Tabs</a></li>
183                  <li><a href="windows.html">Windows</a></li>
184                </ul>
185              </li>
186              <li>Implementation
187                <ul>
188                  <li><a href="a11y.html">Accessibility</a></li>
189                  <li><a href="background_pages.html">Background Pages</a></li>
190                  <li><a href="content_scripts.html">Content Scripts</a></li>
191                  <li><a href="xhr.html">Cross-Origin XHR</a></li>
192                  <li><a href="idle.html">Idle</a></li>
193                  <li><a href="i18n.html">Internationalization</a></li>
194                  <li><a href="messaging.html">Message Passing</a></li>
195                  <li><a href="npapi.html">NPAPI Plugins</a></li>
196                </ul>
197              </li>
198              <li>Finishing
199                <ul>
200                  <li><a href="hosting.html">Hosting</a></li>
201                  <li><a href="external_extensions.html">Other Deployment Options</a></li>
202                </ul>
203              </li>
204            </ul>
205          </li>
206          <li><h2><a href="apps.html">Packaged Apps</a></h2></li>
207          <li><h2><a href="tutorials.html">Tutorials</a></h2>
208            <ul>
209              <li><a href="tut_debugging.html">Debugging</a></li>
210              <li><a href="tut_analytics.html">Google Analytics</a></li>
211              <li><a href="tut_oauth.html">OAuth</a></li>
212            </ul>
213          </li>
214          <li><h2>Reference</h2>
215            <ul>
216              <li>Formats
217                <ul>
218                  <li><a href="manifest.html">Manifest Files</a></li>
219                  <li><a href="match_patterns.html">Match Patterns</a></li>
220                </ul>
221              </li>
222              <li><a href="permission_warnings.html">Permission Warnings</a></li>
223              <li><a href="api_index.html">chrome.* APIs</a></li>
224              <li><a href="api_other.html">Other APIs</a></li>
225            </ul>
226          </li>
227          <li><h2><a href="samples.html">Samples</a></h2></li>
228          <div class="line"> </div>
229          <li><h2>More</h2>
230            <ul>
231              <li class="leftNavSelected">Chrome Web Store</li>
232              <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li>
233              <li><a href="themes.html">Themes</a></li>
234            </ul>
235          </li>
236        </ul>
237      </div>
238      <script>
239        initToggles();
240      </script>
241
242    <div class="g-unit" id="gc-pagecontent">
243      <div id="pageTitle">
244        <h1 class="page_title"></h1>
245      </div>
246        <!-- TABLE OF CONTENTS -->
247        <div id="toc" style="display: none; ">
248          <h2>Contents</h2>
249          <ol>
250            <li>
251              <a>h2Name</a>
252              <ol>
253                <li>
254                  <a>h3Name</a>
255                </li>
256              </ol>
257            </li>
258              <li>
259                <a href="#apiReference">API reference</a>
260                <ol>
261                  <li>
262                    <a href="#properties">Properties</a>
263                    <ol>
264                      <li>
265                        <a href="#property-anchor">propertyName</a>
266                      </li>
267                    </ol>
268                  </li>
269                  <li>
270                    <a href="#methods">Methods</a>
271                    <ol>
272                      <li>
273                        <a href="#method-anchor">methodName</a>
274                      </li>
275                    </ol>
276                  </li>
277                  <li>
278                    <a href="#events">Events</a>
279                    <ol>
280                      <li>
281                        <a href="#event-anchor">eventName</a>
282                      </li>
283                    </ol>
284                  </li>
285                  <li>
286                    <a href="#types">Types</a>
287                    <ol>
288                      <li>
289                        <a href="#id-anchor">id</a>
290                      </li>
291                    </ol>
292                  </li>
293                </ol>
294              </li>
295          </ol>
296        </div>
297        <!-- /TABLE OF CONTENTS -->
298
299        <!-- Standard content lead-in for experimental API pages -->
300        <p id="classSummary" style="display: none; ">
301          For information on how to use experimental APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page.
302        </p>
303
304        <!-- STATIC CONTENT PLACEHOLDER -->
305        <div id="static"><div id="pageData-name" class="pageData"></div>
306<div id="pageData-showSideNav" class="pageData">false</div>
307
308<style>
309cs {
310  border:none;
311  margin:0;
312}
313
314#pics td {
315  padding:0 1em 0 0;
316}
317
318#pics img {
319  border:none;
320}
321</style>
322
323<table class="columns" style="margin:0">
324
325<tbody><tr>
326<td>
327<h3>What are extensions?</h3>
328
329<p>
330Extensions are small software programs that
331can modify and enhance the functionality of the Chrome browser.
332You write them using web technologies such as
333HTML, JavaScript, and CSS.
334You can also use the extension system to build
335<a href="apps.html">packaged apps</a>,
336a downloadable kind of
337<a href="http://code.google.com/chrome/apps/index.html">installable web app</a>.
338</p>
339
340<p>
341<img src="images/index/NEW/gmail.png" width="91" height="35" align="right" style="margin-top:0px; margin-left:0.5em" alt="A screenshot of an extension's icon in the browser bar">
342From a user's point of view,
343extensions and packaged apps are very different 
344because they present very different user interfaces.
345Extensions have little to no user interface.
346For example, the image to the right shows the icon
347that provides the UI for the
348<a href="samples.html#gmail">Gmail extension</a>.
349</p>
350
351<p>
352<img src="images/index/html5app.png" width="200" height="160" align="right" style="margin-top:0px; margin-left:0.5em" alt="A screenshot of a packaged app that implements a jigsaw puzzle">
353Packaged apps, on the other hand,
354look and feel like regular web apps,
355with a big-screen design
356and rich UI.
357The image to the right shows a jigsaw puzzle game
358implemented by a packaged app.
359</p>
360
361<p>
362Both extensions and packaged apps bundle all their files
363into a single file that the user downloads and installs.
364This bundling means that, unlike ordinary web apps,
365extensions and packaged apps don't need to depend
366on content from the web.
367</p>
368
369<p>
370You can distribute your extension or packaged app
371by using the
372<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>
373to publish to the
374<a href="http://chrome.google.com/webstore">Chrome Web Store</a>.
375For more information, see the
376<a href="http://code.google.com/chrome/webstore">store developer documentation</a>.
377</p>
378
379</td>
380<td style="width:330px">
381<h3>How do I start?</h3>
382
383<p>
384</p><ol>
385  <li>
386    Follow the <a href="getstarted.html">Getting Started tutorial</a>
387    <!-- PENDING: once we have one for packaged apps, change to
388      "for _extensions_ or _packaged_apps_" -->
389  </li>
390  <li>
391    Read the
392    <a href="overview.html">Overview</a>
393  </li>
394  <li>
395    Keep up-to-date by reading the
396    <a href="http://blog.chromium.org/">Chromium blog</a>
397  </li>
398  <li>
399    Subscribe to the
400    <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">chromium-extensions group</a>
401    </li>
402</ol>
403<p></p>
404
405<h3>Featured videos</h3>
406
407<p>
408<a href="http://www.youtube.com/view_play_list?p=CA101D6A85FE9D4B">Technical videos</a> <br>
409<a href="http://www.youtube.com/view_play_list?p=38DF05697DE372B1">Developer snapshots</a> (below)
410</p>
411
412<p>
413<object width="300" height="250"><param name="movie" value="http://www.youtube.com/p/38DF05697DE372B1&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/p/38DF05697DE372B1&hl=en_US&fs=1" type="application/x-shockwave-flash" width="300" height="250" allowscriptaccess="always" allowfullscreen="true"></object>
414</p>
415</td>
416</tr>
417</tbody></table>
418</div>
419
420        <!-- API PAGE -->
421        <div class="apiPage" style="display: none; ">
422        <a name="apiReference"></a>
423        <h2>API reference: chrome.apiname </h2>
424
425          <!-- PROPERTIES -->
426          <div class="apiGroup">
427            <a name="properties"></a>
428            <h3 id="properties">Properties</h3>
429
430            <div>
431              <a></a>
432              <h4>getLastError</h4>
433              <div class="summary">
434                <!-- Note: intentionally longer 80 columns -->
435                <span>chrome.extension</span><span>lastError</span>
436              </div>
437              <div>
438              </div>
439            </div>
440
441          </div> <!-- /apiGroup -->
442
443          <!-- METHODS -->
444          <div class="apiGroup" id="methods">
445            <a name="methods"></a>
446            <h3>Methods</h3>
447
448            <!-- iterates over all functions -->
449            <div class="apiItem">
450              <a></a> <!-- method-anchor -->
451              <h4>method name</h4>
452
453              <div class="summary"><span>void</span>
454                  <!-- Note: intentionally longer 80 columns -->
455                  <span>chrome.module.methodName</span>(<span><span>, </span><span></span>
456                      <var><span></span></var></span>)</div>
457
458              <div class="description">
459                <p class="todo">Undocumented.</p>
460                <p>
461                  A description from the json schema def of the function goes here.
462                </p>
463
464                <!-- PARAMETERS -->
465                <h4>Parameters</h4>
466                <dl>
467                  <div>
468                    <div>
469                    </div>
470                  </div>
471                </dl>
472
473                <!-- RETURNS -->
474                <h4>Returns</h4>
475                <dl>
476                  <div>
477                    <div>
478                    </div>
479                  </div>
480                </dl>
481
482                <!-- CALLBACK -->
483                <div>
484                  <div>
485                  <h4>Callback function</h4>
486                  <p>
487                    The callback <em>parameter</em> should specify a function
488                    that looks like this:
489                  </p>
490                  <p>
491                    If you specify the <em>callback</em> parameter, it should
492                    specify a function that looks like this:
493                  </p>
494
495                  <!-- Note: intentionally longer 80 columns -->
496                  <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre>
497                  <dl>
498                    <div>
499                      <div>
500                      </div>
501                    </div>
502                  </dl>
503                  </div>
504                </div>
505
506                <!-- MIN_VERSION -->
507                <p>
508                  This function was added in version <b><span></span></b>.
509                  If you require this function, the manifest key
510                  <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
511                  can ensure that your extension won't be run in an earlier browser version.
512                </p>
513              </div> <!-- /description -->
514
515            </div>  <!-- /apiItem -->
516
517          </div>  <!-- /apiGroup -->
518
519          <!-- EVENTS -->
520          <div class="apiGroup">
521            <a name="events"></a>
522            <h3 id="events">Events</h3>
523
524            <!-- iterates over all events -->
525            <div class="apiItem">
526              <a></a>
527              <h4>event name</h4>
528
529              <div class="summary">
530                <!-- Note: intentionally longer 80 columns -->
531                <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>);
532              </div>
533
534              <div class="description">
535                <p class="todo">Undocumented.</p>
536                <p>
537                  A description from the json schema def of the event goes here.
538                </p>
539
540                <!-- PARAMETERS -->
541                <h4>Parameters</h4>
542                <dl>
543                  <div>
544                    <div>
545                    </div>
546                  </div>
547                </dl>
548
549              </div> <!-- /decription -->
550
551            </div> <!-- /apiItem -->
552
553          </div> <!-- /apiGroup -->
554
555          <!-- TYPES -->
556          <div class="apiGroup">
557            <a name="types"></a>
558            <h3 id="types">Types</h3>
559
560            <!-- iterates over all types -->
561            <div class="apiItem">
562              <a></a>
563              <h4>type name</h4>
564
565              <div>
566              </div>
567
568            </div> <!-- /apiItem -->
569
570          </div> <!-- /apiGroup -->
571
572        </div> <!-- /apiPage -->
573      </div> <!-- /gc-pagecontent -->
574    </div> <!-- /g-section -->
575  </div> <!-- /codesiteContent -->
576    <div id="gc-footer" --="">
577      <div class="text">
578  <p>
579  Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>,
580  the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons
581  Attribution 3.0 License</a>, and code samples are licensed under the
582  <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>.
583  </p>
584  <p>
585  ©2011 Google
586  </p>
587
588<!-- begin analytics -->
589<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
590<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
591
592<script type="text/javascript">
593  // chrome doc tracking
594  try {
595    var engdocs = _gat._getTracker("YT-10763712-2");
596    engdocs._trackPageview();
597  } catch(err) {}
598
599  // code.google.com site-wide tracking
600  try {
601    _uacct="UA-18071-1";
602    _uanchor=1;
603    _uff=0;
604    urchinTracker();
605  }
606  catch(e) {/* urchinTracker not available. */}
607</script>
608<!-- end analytics -->
609      </div>
610    </div> <!-- /gc-footer -->
611  </div> <!-- /gc-container -->
612</body></html>
613