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>Hosting - 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 class="leftNavSelected">Hosting</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">Hosting</h1>
255      </div>
256        <!-- TABLE OF CONTENTS -->
257        <div id="toc" style="display: none; ">
258          <h2>Contents</h2>
259          <ol>
260            <li>
261              <a>h2Name</a>
262              <ol>
263                <li>
264                  <a>h3Name</a>
265                </li>
266              </ol>
267            </li>
268              <li>
269                <a href="#apiReference">API reference</a>
270                <ol>
271                  <li>
272                    <a href="#properties">Properties</a>
273                    <ol>
274                      <li>
275                        <a href="#property-anchor">propertyName</a>
276                      </li>
277                    </ol>
278                  </li>
279                  <li>
280                    <a>Methods</a>
281                    <ol>
282                      <li>
283                        <a href="#method-anchor">methodName</a>
284                      </li>
285                    </ol>
286                  </li>
287                  <li>
288                    <a>Events</a>
289                    <ol>
290                      <li>
291                        <a href="#event-anchor">eventName</a>
292                      </li>
293                    </ol>
294                  </li>
295                  <li>
296                    <a href="#types">Types</a>
297                    <ol>
298                      <li>
299                        <a href="#id-anchor">id</a>
300                      </li>
301                    </ol>
302                  </li>
303                </ol>
304              </li>
305          </ol>
306        </div>
307        <!-- /TABLE OF CONTENTS -->
308
309        <!-- Standard content lead-in for experimental API pages -->
310        <p id="classSummary" style="display: none; ">
311          For information on how to use experimental APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page.
312        </p>
313
314        <!-- STATIC CONTENT PLACEHOLDER -->
315        <div id="static"><div id="pageData-name" class="pageData">Hosting</div>
316
317<p>
318This page tells you how to host <code>.crx</code> files
319on your own server.
320If you distribute your extension, app, or theme solely through the
321<a href="http://chrome.google.com/webstore">Chrome Web Store</a>,
322you don't need this page.
323Instead, consult the store help and
324<a href="http://code.google.com/chrome/webstore/index.html">developer documentation</a>.
325<!-- PENDING: add a link to the help -->
326</p>
327
328<p class="note">
329<strong>Note:</strong>
330If you've already published extensions to the 
331<a href="https://chrome.google.com/extensions">Extensions Gallery</a>,
332they will be merged into the store.
333</p>
334
335<p>
336By convention, extensions,
337installable web apps, and themes are servedâwhether
338by the Chrome Web Store or by a custom serverâas
339<code>.crx</code> files.
340When you upload a ZIP file with the
341<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>,
342the dashboard creates the <code>.crx</code> file for you.
343</p>
344
345<p>
346If you aren't publishing using the dashboard,
347you need to create the <code>.crx</code> file yourself,
348as described in <a href="packaging.html">Packaging</a>.
349You can also specify
350<a href="autoupdate.html">autoupdate</a> information to ensure that
351your users will have the latest copy of the <code>.crx</code> file.
352</p>
353
354<p>
355A server that hosts <code>.crx</code> files
356must use appropriate HTTP headers,
357so that users can install the file
358by clicking a link to it.
359</p>
360
361<p>
362Google Chrome considers a file to be installable
363if <b>either</b> of the following is true:
364</p>
365
366<ul>
367  <li>
368    The file has the content type
369    <code>application/x-chrome-extension</code>
370  </li>
371  <li>
372    The file suffix is <code>.crx</code>
373    and <b>both</b> of the following are true:
374    <ul>
375      <li>
376        The file <b>is not</b> served with
377        the HTTP header <code>X-Content-Type-Options: nosniff</code>
378      </li>
379      <li>
380        The file <b>is</b> served
381        with one of the following content types:
382        <ul>
383          <li> empty string </li>
384          <li> "text/plain" </li>
385          <li> "application/octet-stream" </li>
386          <li> "unknown/unknown" </li>
387          <li> "application/unknown" </li>
388          <li> "*/*" </li>
389        </ul>
390      </li>
391    </ul>
392  </li>
393</ul>
394
395<p>
396The most common reason for failing to recognize an installable file
397is that the server sends the header
398<code>X-Content-Type-Options: no sniff</code>.
399The second most common reason
400is that the server sends an unknown content typeâone
401that isn't in the previous list.
402To fix an HTTP header issue,
403either change the configuration of the server
404or try hosting the <code>.crx</code> file at another server.
405</p>
406</div>
407
408        <!-- API PAGE -->
409        <div class="apiPage" style="display: none; ">
410        <a name="apiReference"></a>
411        <h2>API reference: chrome.apiname </h2>
412
413          <!-- PROPERTIES -->
414          <div class="apiGroup">
415            <a name="properties"></a>
416            <h3 id="properties">Properties</h3>
417
418            <div>
419              <a></a>
420              <h4>getLastError</h4>
421              <div class="summary">
422                <!-- Note: intentionally longer 80 columns -->
423                <span>chrome.extension</span><span>lastError</span>
424              </div>
425              <div>
426              </div>
427            </div>
428
429          </div> <!-- /apiGroup -->
430
431          <!-- METHODS -->
432          <div id="methodsTemplate" class="apiGroup">
433            <a></a>
434            <h3>Methods</h3>
435
436            <!-- iterates over all functions -->
437            <div class="apiItem">
438              <a></a> <!-- method-anchor -->
439              <h4>method name</h4>
440
441              <div class="summary"><span>void</span>
442                  <!-- Note: intentionally longer 80 columns -->
443                  <span>chrome.module.methodName</span>(<span><span>, </span><span></span>
444                      <var><span></span></var></span>)</div>
445
446              <div class="description">
447                <p class="todo">Undocumented.</p>
448                <p>
449                  A description from the json schema def of the function goes here.
450                </p>
451
452                <!-- PARAMETERS -->
453                <h4>Parameters</h4>
454                <dl>
455                  <div>
456                    <div>
457                    </div>
458                  </div>
459                </dl>
460
461                <!-- RETURNS -->
462                <h4>Returns</h4>
463                <dl>
464                  <div>
465                    <div>
466                    </div>
467                  </div>
468                </dl>
469
470                <!-- CALLBACK -->
471                <div>
472                  <div>
473                  <h4>Callback function</h4>
474                  <p>
475                    The callback <em>parameter</em> should specify a function
476                    that looks like this:
477                  </p>
478                  <p>
479                    If you specify the <em>callback</em> parameter, it should
480                    specify a function that looks like this:
481                  </p>
482
483                  <!-- Note: intentionally longer 80 columns -->
484                  <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre>
485                  <dl>
486                    <div>
487                      <div>
488                      </div>
489                    </div>
490                  </dl>
491                  </div>
492                </div>
493
494                <!-- MIN_VERSION -->
495                <p>
496                  This function was added in version <b><span></span></b>.
497                  If you require this function, the manifest key
498                  <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a>
499                  can ensure that your extension won't be run in an earlier browser version.
500                </p>
501              </div> <!-- /description -->
502
503            </div>  <!-- /apiItem -->
504
505          </div>  <!-- /apiGroup -->
506
507          <!-- EVENTS -->
508          <div id="eventsTemplate" class="apiGroup">
509            <a></a>
510            <h3>Events</h3>
511            <!-- iterates over all events -->
512            <div class="apiItem">
513              <a></a>
514              <h4>event name</h4>
515
516              <div class="summary">
517                <!-- Note: intentionally longer 80 columns -->
518                <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>);
519              </div>
520
521              <div class="description">
522                <p class="todo">Undocumented.</p>
523                <p>
524                  A description from the json schema def of the event goes here.
525                </p>
526
527                <!-- PARAMETERS -->
528                <div>
529                  <h4>Parameters</h4>
530                  <dl>
531                    <div>
532                      <div>
533                      </div>
534                    </div>
535                  </dl>
536                </div>
537              </div> <!-- /decription -->
538
539            </div> <!-- /apiItem -->
540
541          </div> <!-- /apiGroup -->
542
543          <!-- TYPES -->
544          <div class="apiGroup">
545            <a name="types"></a>
546            <h3 id="types">Types</h3>
547
548            <!-- iterates over all types -->
549            <div class="apiItem">
550              <a></a>
551              <h4>type name</h4>
552
553              <div>
554              </div>
555
556            </div> <!-- /apiItem -->
557
558          </div> <!-- /apiGroup -->
559
560        </div> <!-- /apiPage -->
561      </div> <!-- /gc-pagecontent -->
562    </div> <!-- /g-section -->
563  </div> <!-- /codesiteContent -->
564    <div id="gc-footer" --="">
565      <div class="text">
566  <p>
567  Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>,
568  the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons
569  Attribution 3.0 License</a>, and code samples are licensed under the
570  <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>.
571  </p>
572  <p>
573  ©2011 Google
574  </p>
575
576<!-- begin analytics -->
577<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
578<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
579
580<script type="text/javascript">
581  // chrome doc tracking
582  try {
583    var engdocs = _gat._getTracker("YT-10763712-2");
584    engdocs._trackPageview();
585  } catch(err) {}
586
587  // code.google.com site-wide tracking
588  try {
589    _uacct="UA-18071-1";
590    _uanchor=1;
591    _uff=0;
592    urchinTracker();
593  }
594  catch(e) {/* urchinTracker not available. */}
595</script>
596<!-- end analytics -->
597      </div>
598    </div> <!-- /gc-footer -->
599  </div> <!-- /gc-container -->
600</body></html>
601