Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: chrome/common/extensions/docs/apps.html

Issue 5398002: doc stuff (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:mime-type
+ text/html
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc. Note:
2 1) The <head> information in this page is significant, should be uniform
3 across api docs and should be edited only with knowledge of the
4 templating mechanism.
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a
6 browser, it will be re-generated from the template, json schema and
7 authored overview content.
8 4) The <body>.innerHTML is also generated by an offline step so that this
9 page may easily be indexed by search engines.
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head>
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css">
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print">
14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla te_compiled.js">
15 </script>
16 <script type="text/javascript" src="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>Packaged Apps - 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_versio n</a>
71 can ensure that your extension won't be run in an earlier browser ve rsion.
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/c ode_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_cvz fqtno">
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="Se arch">
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"></scr ipt>
124 <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
125 <script type="text/javascript" src="http://www.google.com/coop/cse/t13 n?form=cse&amp;t13n_langs=en"></script>
126 <script type="text/javascript" src="http://www.google.com/coop/cse/bra nd?form=cse&amp;lang=en"></script>
127 </td>
128 </tr>
129 </tbody></table>
130
131 <div id="codesiteContent" class="">
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/">Lab s</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 documen tation">Docs</a>
142 </li>
143 <li id="faq_link">
144 <a href="faq.html" title="Answers to frequently asked questions abou t 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-exte nsions" 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">
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 Option s</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><a href="http://code.google.com/chrome/webstore/docs/index.htm l">Chrome Web Store</a></li>
232 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu ide.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">Packaged Apps</h1>
245 </div>
246 <!-- TABLE OF CONTENTS -->
247 <div id="toc">
248 <h2>Contents</h2>
249 <ol>
250 <li>
251 <a href="#overview">Overview</a>
252 <ol>
253 <li style="display: none; ">
254 <a>h3Name</a>
255 </li>
256 </ol>
257 </li><li>
258 <a href="#manifest"> The manifest </a>
259 <ol>
260 <li style="display: none; ">
261 <a>h3Name</a>
262 </li>
263 </ol>
264 </li><li>
265 <a href="#next">What next?</a>
266 <ol>
267 <li style="display: none; ">
268 <a>h3Name</a>
269 </li>
270 </ol>
271 </li>
272 <li style="display: none; ">
273 <a href="#apiReference">API reference</a>
274 <ol>
275 <li>
276 <a href="#properties">Properties</a>
277 <ol>
278 <li>
279 <a href="#property-anchor">propertyName</a>
280 </li>
281 </ol>
282 </li>
283 <li>
284 <a href="#methods">Methods</a>
285 <ol>
286 <li>
287 <a href="#method-anchor">methodName</a>
288 </li>
289 </ol>
290 </li>
291 <li>
292 <a href="#events">Events</a>
293 <ol>
294 <li>
295 <a href="#event-anchor">eventName</a>
296 </li>
297 </ol>
298 </li>
299 <li>
300 <a href="#types">Types</a>
301 <ol>
302 <li>
303 <a href="#id-anchor">id</a>
304 </li>
305 </ol>
306 </li>
307 </ol>
308 </li>
309 </ol>
310 </div>
311 <!-- /TABLE OF CONTENTS -->
312
313 <!-- Standard content lead-in for experimental API pages -->
314 <p id="classSummary" style="display: none; ">
315 For information on how to use experimental APIs, see the <a href="expe rimental.html">chrome.experimental.* APIs</a> page.
316 </p>
317
318 <!-- STATIC CONTENT PLACEHOLDER -->
319 <div id="static"><div id="pageData-name" class="pageData">Packaged Apps< /div>
320 <div id="pageData-showTOC" class="pageData">true</div>
321
322 <p>
323 This page talks about packaged apps—how
324 you implement them,
325 and how they're different from
326 extensions and ordinary web apps.
327 </p>
328
329
330 <h2 id="overview">Overview</h2>
331
332 <p>
333 A packaged app is a web app
334 that's bundled into a <code>.crx</code> file
335 and can use Chrome extension features.
336 You build a packaged app just like you build an extension,
337 except that a packaged app can't include a
338 <a href="browserAction.html">browser action</a> or
339 <a href="pageAction.html">page action</a>.
340 Instead, a packaged app includes at least one HTML file
341 within its <code>.crx</code> file
342 that provides the app's user interface.
343 </p>
344
345 <p>
346 Packaged apps are a type of
347 <a href="http://code.google.com/chrome/apps/">installable web app</a>—a
348 web app that can be installed in Chrome.
349 The other type of installable web app is a
350 <a href="http://code.google.com/chrome/apps/docs/developers_guide.html">hosted a pp</a>,
351 which is an ordinary web app with a bit of additional metadata.
352 </p>
353
354 <p>
355 If you're developing a web app for the Chrome Web Store,
356 you might want to use a packaged app
357 instead of a hosted app if any of the following are true:
358 </p>
359
360 <ul>
361 <li>
362 You don't want to run a service to host your app.
363 </li>
364 <li>
365 You want to build an app that works really well offline.
366 </li>
367 <li>
368 You want tighter integration with Chrome,
369 using the extension APIs.
370 </li>
371 </ul>
372
373 <p>
374 The following articles can help you understand
375 the differences between web apps and websites,
376 extensions and packaged apps, and packaged apps and hosted apps:
377 </p>
378
379 <ul>
380 <li> <a href="http://code.google.com/chrome/apps/articles/thinking_in_web_apps .html">Thinking in Web Apps</a> </li>
381 <li> <a href="http://codesite-staging:29006/chrome/webstore/articles/apps_vs_e xtensions.html">Extensions, Packaged Apps, and Hosted Apps in the Chrome Web Sto re</a> </li>
382 </ul>
383
384
385 <h2 id="manifest"> The manifest </h2>
386
387 <p>
388 A packaged app's manifest can have any field
389 that's available to extensions,
390 except for "browser_action" and "page_action".
391 In addition, a packaged app's manifest <b>must</b>
392 have an "app" field.
393 Here is a typical manifest for a packaged app:
394 </p>
395
396 <pre>{
397 "name": "My Awesome Racing Game",
398 "description": "Enter a world where a Vanagon can beat a Maserati",
399 "version": "1",
400 <b>"app": {
401 "launch": {
402 "local_path": "main.html"
403 }
404 },</b>
405 "icons": {
406 "16": "icon_16.png",
407 "128": "icon_128.png"
408 },
409 "permissions": [
410 "unlimitedStorage",
411 "notifications"
412 ]
413 }
414 </pre>
415
416 <p>
417 The "app" field has one subfield, "launch",
418 which specifies the <em>launch page</em> for the app—the
419 page (HTML file bundled into the <code>.crx</code> file)
420 that the browser goes to when the user clicks the app's icon
421 in the New Tab page.
422 The "launch" field can contain the following:
423 </p>
424
425 <dl>
426 <dt>local_path:</dt>
427 <dd><em>Required.</em>
428 Specifies the launch page
429 as a relative path referring to a file
430 in the <code>.crx</code> package.
431 </dd>
432 <dt>container:</dt>
433 <dd> The value "panel" makes the app appear
434 in an app panel.
435 By default, or when you specify "tab",
436 the app appears in a tab.
437
438 <!-- PENDING: In the overview
439 (or somewhere else before here)
440 we should show and define both app panels and tabs.
441 We should link to that place from here. -->
442 </dd>
443 <dt>height:</dt>
444 <dd>
445 If the container is set to "panel",
446 this integer specifies the height
447 of the panel in pixels.
448 For example, you might specify
449 <code>"height":400</code>.
450 Note that you don't use quotation marks in the value.
451 This field specifies the height of the area
452 to display contents in;
453 window decorations add a few more pixels to the total height.
454 If the container isn't a panel, this field is ignored.
455 </dd>
456 <dt>width:</dt>
457 <dd>
458 Similar to "height",
459 but specifies the width of the panel.
460 </dd>
461
462 </dl>
463
464 <p>
465 Packaged apps usually provide a 16x16 icon
466 to be used as the favicon for
467 tabs that contain app's pages.
468 They also should provide a 128x128 icon,
469 but not a 48x48 icon.
470 See the manifest documentation for the
471 <a href="manifest.html#icons">"icons" field</a>
472 for more information.
473 </p>
474
475 <p>
476 For further details on what a packaged app's manifest can contain, see the
477 <a href="manifest.html">manifest documentation</a>.
478 </p>
479
480 <h2 id="next">What next?</h2>
481
482 <p>
483 Read the <a href="overview.html">Overview</a> to learn
484 basic concepts about extensions.
485 </p>
486
487 <p class="backtotop"><a href="#top">Back to top</a></p>
488
489 </div>
490
491 <!-- API PAGE -->
492 <div class="apiPage" style="display: none; ">
493 <a name="apiReference"></a>
494 <h2>API reference: chrome.apiname </h2>
495
496 <!-- PROPERTIES -->
497 <div class="apiGroup">
498 <a name="properties"></a>
499 <h3 id="properties">Properties</h3>
500
501 <div>
502 <a></a>
503 <h4>getLastError</h4>
504 <div class="summary">
505 <!-- Note: intentionally longer 80 columns -->
506 <span>chrome.extension</span><span>lastError</span>
507 </div>
508 <div>
509 </div>
510 </div>
511
512 </div> <!-- /apiGroup -->
513
514 <!-- METHODS -->
515 <div class="apiGroup" id="methods">
516 <a name="methods"></a>
517 <h3>Methods</h3>
518
519 <!-- iterates over all functions -->
520 <div class="apiItem">
521 <a></a> <!-- method-anchor -->
522 <h4>method name</h4>
523
524 <div class="summary"><span>void</span>
525 <!-- Note: intentionally longer 80 columns -->
526 <span>chrome.module.methodName</span>(<span><span>, </span><sp an></span>
527 <var><span></span></var></span>)</div>
528
529 <div class="description">
530 <p class="todo">Undocumented.</p>
531 <p>
532 A description from the json schema def of the function goes he re.
533 </p>
534
535 <!-- PARAMETERS -->
536 <h4>Parameters</h4>
537 <dl>
538 <div>
539 <div>
540 </div>
541 </div>
542 </dl>
543
544 <!-- RETURNS -->
545 <h4>Returns</h4>
546 <dl>
547 <div>
548 <div>
549 </div>
550 </div>
551 </dl>
552
553 <!-- CALLBACK -->
554 <div>
555 <div>
556 <h4>Callback function</h4>
557 <p>
558 The callback <em>parameter</em> should specify a function
559 that looks like this:
560 </p>
561 <p>
562 If you specify the <em>callback</em> parameter, it should
563 specify a function that looks like this:
564 </p>
565
566 <!-- Note: intentionally longer 80 columns -->
567 <pre>function(<span>Type param1, Type param2</span>) <span cla ss="subdued">{...}</span>;</pre>
568 <dl>
569 <div>
570 <div>
571 </div>
572 </div>
573 </dl>
574 </div>
575 </div>
576
577 <!-- MIN_VERSION -->
578 <p>
579 This function was added in version <b><span></span></b>.
580 If you require this function, the manifest key
581 <a href="manifest.html#minimum_chrome_version">minimum_chrome_ version</a>
582 can ensure that your extension won't be run in an earlier brow ser version.
583 </p>
584 </div> <!-- /description -->
585
586 </div> <!-- /apiItem -->
587
588 </div> <!-- /apiGroup -->
589
590 <!-- EVENTS -->
591 <div class="apiGroup">
592 <a name="events"></a>
593 <h3 id="events">Events</h3>
594
595 <!-- iterates over all events -->
596 <div class="apiItem">
597 <a></a>
598 <h4>event name</h4>
599
600 <div class="summary">
601 <!-- Note: intentionally longer 80 columns -->
602 <span class="subdued">chrome.bookmarks</span><span>onEvent</span ><span class="subdued">.addListener</span>(function(<span>Type param1, Type para m2</span>) <span class="subdued">{...}</span>);
603 </div>
604
605 <div class="description">
606 <p class="todo">Undocumented.</p>
607 <p>
608 A description from the json schema def of the event goes here.
609 </p>
610
611 <!-- PARAMETERS -->
612 <h4>Parameters</h4>
613 <dl>
614 <div>
615 <div>
616 </div>
617 </div>
618 </dl>
619
620 </div> <!-- /decription -->
621
622 </div> <!-- /apiItem -->
623
624 </div> <!-- /apiGroup -->
625
626 <!-- TYPES -->
627 <div class="apiGroup">
628 <a name="types"></a>
629 <h3 id="types">Types</h3>
630
631 <!-- iterates over all types -->
632 <div class="apiItem">
633 <a></a>
634 <h4>type name</h4>
635
636 <div>
637 </div>
638
639 </div> <!-- /apiItem -->
640
641 </div> <!-- /apiGroup -->
642
643 </div> <!-- /apiPage -->
644 </div> <!-- /gc-pagecontent -->
645 </div> <!-- /g-section -->
646 </div> <!-- /codesiteContent -->
647 <div id="gc-footer" --="">
648 <div class="text">
649 <p>
650 Except as otherwise <a href="http://code.google.com/policies.html#restrictions ">noted</a>,
651 the content of this page is licensed under the <a rel="license" href="http://c reativecommons.org/licenses/by/3.0/">Creative Commons
652 Attribution 3.0 License</a>, and code samples are licensed under the
653 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic ense</a>.
654 </p>
655 <p>
656 ©2010 Google
657 </p>
658
659 <!-- begin analytics -->
660 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">< /script>
661 <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></scr ipt>
662
663 <script type="text/javascript">
664 // chrome doc tracking
665 try {
666 var engdocs = _gat._getTracker("YT-10763712-2");
667 engdocs._trackPageview();
668 } catch(err) {}
669
670 // code.google.com site-wide tracking
671 try {
672 _uacct="UA-18071-1";
673 _uanchor=1;
674 _uff=0;
675 urchinTracker();
676 }
677 catch(e) {/* urchinTracker not available. */}
678 </script>
679 <!-- end analytics -->
680 </div>
681 </div> <!-- /gc-footer -->
682 </div> <!-- /gc-container -->
683 </body></html>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/api_other.html ('k') | chrome/common/extensions/docs/autoupdate.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698