OLD | NEW |
| (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="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | |
17 </script> | |
18 <script type="text/javascript" src="js/api_page_generator.js"></script> | |
19 <script type="text/javascript" src="js/bootstrap.js"></script> | |
20 <script type="text/javascript" src="js/sidebar.js"></script> | |
21 <title>Formats: Manifest Files - Google Chrome Extensions - Google Code</title
></head> | |
22 <body> <div id="devModeWarning" class="displayModeWarning"> | |
23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. | |
24 </div> | |
25 <div id="branchWarning" class="displayModeWarning"> | |
26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | |
27 It may not work with the stable release of Chrome.</span> | |
28 <select id="branchChooser"> | |
29 <option>Choose a different version... | |
30 </option><option value="">Stable | |
31 </option><option value="beta">Beta | |
32 </option><option value="dev">Dev | |
33 </option><option value="trunk">Trunk | |
34 </option></select> | |
35 </div> | |
36 <div id="unofficialWarning" class="displayModeWarning"> | |
37 <span>WARNING: This is unofficial documentation. It may not work with the | |
38 current release of Chrome.</span> | |
39 <button id="goToOfficialDocs">Go to the official docs</button> | |
40 </div> | |
41 <div id="gc-container" class="labs"> | |
42 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | |
43 <!-- In particular, sub-templates that recurse, must be used by allowing | |
44 jstemplate to make a copy of the template in this section which | |
45 are not operated on by way of the jsskip="true" --> | |
46 <!-- /SUBTEMPLATES --> | |
47 <a id="top"></a> | |
48 <div id="skipto"> | |
49 <a href="#gc-pagecontent">Skip to page content</a> | |
50 <a href="#gc-toc">Skip to main navigation</a> | |
51 </div> | |
52 <!-- API HEADER --> | |
53 <table id="header" width="100%" cellspacing="0" border="0"> | |
54 <tbody><tr> | |
55 <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> | |
56 <td valign="middle" width="100%" style="padding-left:0.6em;"> | |
57 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.
5em"> | |
58 <div id="gsc-search-box"> | |
59 <input type="hidden" name="cx" value="002967670403910741006:61_cvz
fqtno"> | |
60 <input type="hidden" name="ie" value="UTF-8"> | |
61 <input type="text" name="q" value="" size="55"> | |
62 <input class="gsc-search-button" type="submit" name="sa" value="Se
arch"> | |
63 <br> | |
64 <span class="greytext">e.g. "page action" or "tabs"</span> | |
65 </div> | |
66 </form> | |
67 <script type="text/javascript" src="https://www.google.com/jsapi"></sc
ript> | |
68 <script type="text/javascript">google.load("elements", "1", {packages:
"transliteration"});</script> | |
69 <script type="text/javascript" src="https://www.google.com/coop/cse/t1
3n?form=cse&t13n_langs=en"></script> | |
70 <script type="text/javascript" src="https://www.google.com/coop/cse/br
and?form=cse&lang=en"></script> | |
71 </td> | |
72 </tr> | |
73 </tbody></table> | |
74 <div id="codesiteContent" class=""> | |
75 <a id="gc-topnav-anchor"></a> | |
76 <div id="gc-topnav"> | |
77 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab
s</a>)</h1> | |
78 <ul id="home" class="gc-topnav-tabs"> | |
79 <li id="home_link"> | |
80 <a href="index.html" title="Google Chrome Extensions home page">Home
</a> | |
81 </li> | |
82 <li id="docs_link"> | |
83 <a href="docs.html" title="Official Google Chrome Extensions documen
tation">Docs</a> | |
84 </li> | |
85 <li id="faq_link"> | |
86 <a href="faq.html" title="Answers to frequently asked questions abou
t Google Chrome Extensions">FAQ</a> | |
87 </li> | |
88 <li id="samples_link"> | |
89 <a href="samples.html" title="Sample extensions (with source code)">
Samples</a> | |
90 </li> | |
91 <li id="group_link"> | |
92 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte
nsions" title="Google Chrome Extensions developer forum">Group</a> | |
93 </li> | |
94 <li id="so_link"> | |
95 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext
ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a> | |
96 </li> | |
97 </ul> | |
98 </div> <!-- end gc-topnav --> | |
99 <div class="g-section g-tpl-170"> | |
100 <!-- SIDENAV --> | |
101 <div class="g-unit g-first" id="gc-toc"> | |
102 <ul> | |
103 <li><a href="getstarted.html">Getting Started</a></li> | |
104 <li><a href="overview.html">Overview</a></li> | |
105 <li><a href="whats_new.html">What's New?</a></li> | |
106 <li><h2><a href="devguide.html">Developer's Guide</a></h2> | |
107 <ul> | |
108 <li>Browser UI | |
109 <ul> | |
110 <li><a href="browserAction.html">Browser Actions</a></li> | |
111 <li><a href="contextMenus.html">Context Menus</a></li> | |
112 <li><a href="notifications.html">Desktop Notifications</a></li
> | |
113 <li><a href="omnibox.html">Omnibox</a></li> | |
114 <li><a href="options.html">Options Pages</a></li> | |
115 <li><a href="override.html">Override Pages</a></li> | |
116 <li><a href="pageAction.html">Page Actions</a></li> | |
117 </ul> | |
118 </li> | |
119 <li>Browser Interaction | |
120 <ul> | |
121 <li><a href="bookmarks.html">Bookmarks</a></li> | |
122 <li><a href="cookies.html">Cookies</a></li> | |
123 <li><a href="devtools.html">Developer Tools</a></li> | |
124 <li><a href="events.html">Events</a></li> | |
125 <li><a href="history.html">History</a></li> | |
126 <li><a href="management.html">Management</a></li> | |
127 <li><a href="tabs.html">Tabs</a></li> | |
128 <li><a href="windows.html">Windows</a></li> | |
129 </ul> | |
130 </li> | |
131 <li>Implementation | |
132 <ul> | |
133 <li><a href="a11y.html">Accessibility</a></li> | |
134 <li><a href="background_pages.html">Background Pages</a></li> | |
135 <li><a href="content_scripts.html">Content Scripts</a></li> | |
136 <li><a href="xhr.html">Cross-Origin XHR</a></li> | |
137 <li><a href="i18n.html">Internationalization</a></li> | |
138 <li><a href="messaging.html">Message Passing</a></li> | |
139 <li><a href="permissions.html">Optional Permissions</a></li> | |
140 <li><a href="npapi.html">NPAPI Plugins</a></li> | |
141 </ul> | |
142 </li> | |
143 <li>Finishing | |
144 <ul> | |
145 <li><a href="hosting.html">Hosting</a></li> | |
146 <li><a href="external_extensions.html">Other Deployment Option
s</a></li> | |
147 </ul> | |
148 </li> | |
149 </ul> | |
150 </li> | |
151 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> | |
152 <li><h2><a href="tutorials.html">Tutorials</a></h2> | |
153 <ul> | |
154 <li><a href="tut_debugging.html">Debugging</a></li> | |
155 <li><a href="tut_analytics.html">Google Analytics</a></li> | |
156 <li><a href="tut_oauth.html">OAuth</a></li> | |
157 </ul> | |
158 </li> | |
159 <li><h2>Reference</h2> | |
160 <ul> | |
161 <li>Formats | |
162 <ul> | |
163 <li class="leftNavSelected">Manifest Files</li> | |
164 <li><a href="match_patterns.html">Match Patterns</a></li> | |
165 </ul> | |
166 </li> | |
167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> | |
168 <li><a href="api_index.html">chrome.* APIs</a></li> | |
169 <li><a href="api_other.html">Other APIs</a></li> | |
170 </ul> | |
171 </li> | |
172 <li><h2><a href="samples.html">Samples</a></h2></li> | |
173 <div class="line"> </div> | |
174 <li><h2>More</h2> | |
175 <ul> | |
176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm
l">Chrome Web Store</a></li> | |
177 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu
ide.html">Hosted Apps</a></li> | |
178 <li><a href="themes.html">Themes</a></li> | |
179 </ul> | |
180 </li> | |
181 </ul> | |
182 </div> | |
183 <script> | |
184 initToggles(); | |
185 </script> | |
186 <div class="g-unit" id="gc-pagecontent"> | |
187 <div id="pageTitle"> | |
188 <h1 class="page_title">Formats: Manifest Files</h1> | |
189 </div> | |
190 <!-- TABLE OF CONTENTS --> | |
191 <div id="toc"> | |
192 <h2>Contents</h2> | |
193 <ol> | |
194 <li> | |
195 <a href="#overview"> Field summary </a> | |
196 <ol> | |
197 </ol> | |
198 </li><li> | |
199 <a href="#H2-1">Field details</a> | |
200 <ol> | |
201 <li> | |
202 <a href="#app">app</a> | |
203 </li><li> | |
204 <a href="#default_locale">default_locale</a> | |
205 </li><li> | |
206 <a href="#description">description</a> | |
207 </li><li> | |
208 <a href="#homepage_url">homepage_url</a> | |
209 </li><li> | |
210 <a href="#icons">icons</a> | |
211 </li><li> | |
212 <a href="#incognito">incognito</a> | |
213 </li><li> | |
214 <a href="#intents">intents</a> | |
215 </li><li> | |
216 <a href="#key">key</a> | |
217 </li><li> | |
218 <a href="#minimum_chrome_version">minimum_chrome_version</a> | |
219 </li><li> | |
220 <a href="#name">name</a> | |
221 </li><li> | |
222 <a href="#nacl_modules">nacl_modules</a> | |
223 </li><li> | |
224 <a href="#offline_enabled">offline_enabled</a> | |
225 </li><li> | |
226 <a href="#permissions">permissions</a> | |
227 </li><li> | |
228 <a href="#requirements">requirements</a> | |
229 </li><li> | |
230 <a href="#version">version</a> | |
231 </li><li> | |
232 <a href="#manifest_version">manifest_version</a> | |
233 </li><li> | |
234 <a href="#web_accessible_resources">web_accessible_resources</
a> | |
235 </li><li> | |
236 <a href="#sandbox">sandbox</a> | |
237 </li> | |
238 </ol> | |
239 </li> | |
240 </ol> | |
241 </div> | |
242 <!-- /TABLE OF CONTENTS --> | |
243 <!-- Standard content lead-in for experimental API pages --> | |
244 <!-- STATIC CONTENT PLACEHOLDER --> | |
245 <div id="static"><div id="pageData-name" class="pageData">Formats: Manif
est Files</div> | |
246 <div id="pageData-showTOC" class="pageData">true</div> | |
247 <p> | |
248 Every extension, installable web app, and theme has a | |
249 <a href="http://www.json.org">JSON</a>-formatted manifest file, | |
250 named <code>manifest.json</code>, | |
251 that provides important information. | |
252 </p> | |
253 <h2 id="overview"> Field summary </h2> | |
254 <p> | |
255 The following code shows the supported manifest fields, | |
256 with links to the page that discusses each field. | |
257 The only fields that are always required | |
258 are <b>name</b> and <b>version</b>. | |
259 </p> | |
260 <pre>{ | |
261 <em>// Required</em> | |
262 "<a href="#name">name</a>": "<em>My Extension</em>", | |
263 "<a href="#version">version</a>": "<em>versionString</em>", | |
264 "<a href="#manifest_version">manifest_version</a>": 2, | |
265 <em>// Recommended</em> | |
266 "<a href="#description">description</a>": "<em>A plain text description</em>", | |
267 "<a href="#icons">icons</a>": { ... }, | |
268 "<a href="#default_locale">default_locale</a>": "<em>en</em>", | |
269 <em>// Pick one (or none)</em> | |
270 "<a href="browserAction.html">browser_action</a>": {...}, | |
271 "<a href="pageAction.html">page_action</a>": {...}, | |
272 "<a href="themes.html">theme</a>": {...}, | |
273 "<a href="#app">app</a>": {...}, | |
274 <em>// Add any of these that you need</em> | |
275 "<a href="background_pages.html">background</a>": {...}, | |
276 "<a href="override.html">chrome_url_overrides</a>": {...}, | |
277 "<a href="content_scripts.html">content_scripts</a>": [...], | |
278 "<a href="contentSecurityPolicy.html">content_security_policy</a>": "<em>polic
yString</em>", | |
279 "<a href="fileBrowserHandler.html">file_browser_handlers</a>": [...], | |
280 "<a href="#homepage_url">homepage_url</a>": "http://<em>path/to/homepage</em>"
, | |
281 "<a href="#incognito">incognito</a>": "spanning" <em>or</em> "split", | |
282 "<a href="#intents">intents</a>": {...} | |
283 "<a href="#key">key</a>": "<em>publicKey</em>", | |
284 "<a href="#minimum_chrome_version">minimum_chrome_version</a>": "<em>versionSt
ring</em>", | |
285 "<a href="#nacl_modules">nacl_modules</a>": [...], | |
286 "<a href="#offline_enabled">offline_enabled</a>": true, | |
287 "<a href="omnibox.html">omnibox</a>": { "keyword": "<em>aString</em>" }, | |
288 "<a href="options.html">options_page</a>": "<em>aFile</em>.html", | |
289 "<a href="#permissions">permissions</a>": [...], | |
290 "<a href="npapi.html">plugins</a>": [...], | |
291 "<a href="#requirements">requirements</a>": {...}, | |
292 "<a href="autoupdate.html">update_url</a>": "http://<em>path/to/updateInfo</em
>.xml", | |
293 "<a href="#web_accessible_resources">web_accessible_resources</a>": [...], | |
294 "<a href="#sandbox">sandbox</a>": [...] | |
295 } | |
296 </pre> | |
297 <a name="H2-1"></a><h2>Field details</h2> | |
298 <p> | |
299 This section covers fields that aren't described in another page. | |
300 For a complete list of fields, | |
301 with links to where they're described in detail, | |
302 see the <a href="#overview">Field summary</a>. | |
303 </p> | |
304 <h3 id="app">app</h3> | |
305 <p> | |
306 Used by installable web apps, | |
307 including packaged apps, | |
308 to specify the URLs that the app uses. | |
309 Most important is the <em>launch page</em> for the app—the | |
310 page that the browser goes to when the user clicks the app's icon | |
311 in the New Tab page. | |
312 </p> | |
313 <p> | |
314 For details, see the documentation for | |
315 <a href="http://code.google.com/chrome/apps/docs/developers_guide.html">hosted a
pps</a> and | |
316 <a href="apps.html">packaged apps</a>. | |
317 </p> | |
318 <h3 id="default_locale">default_locale</h3> | |
319 <p> | |
320 Specifies the subdirectory of <code>_locales</code> | |
321 that contains the default strings for this extension. | |
322 This field is <b>required</b> in extensions | |
323 that have a <code>_locales</code> directory; | |
324 it <b>must be absent</b> in extensions | |
325 that have no <code>_locales</code> directory. | |
326 For details, see | |
327 <a href="i18n.html">Internationalization</a>. | |
328 </p> | |
329 <h3 id="description">description</h3> | |
330 <p> | |
331 A plain text string | |
332 (no HTML or other formatting; | |
333 no more than 132 characters) | |
334 that describes the extension. | |
335 The description should be suitable for both | |
336 the browser's extension management UI | |
337 and the <a href="https://chrome.google.com/webstore">Chrome Web Store</a>. | |
338 You can specify locale-specific strings for this field; | |
339 see <a href="i18n.html">Internationalization</a> for details. | |
340 </p> | |
341 <h3 id="homepage_url">homepage_url</h3> | |
342 <p> | |
343 The URL of the homepage for this extension. The extensions management page (chro
me://extensions) | |
344 will contain a link to this URL. This field is particularly useful if you | |
345 <a href="hosting.html">host the extension on your own site</a>. If you distribut
e your | |
346 extension using the <a href="https://chrome.google.com/webstore">Chrome Web Stor
e</a>, | |
347 the homepage URL defaults to the extension's own page. | |
348 </p> | |
349 <h3 id="icons">icons</h3> | |
350 <p> | |
351 One or more icons that represent the extension, app, or theme. | |
352 You should always provide a 128x128 icon; | |
353 it's used during installation and by the Chrome Web Store. | |
354 Extensions should also provide a 48x48 icon, | |
355 which is used in the extensions management page | |
356 (chrome://extensions). | |
357 You can also specify a 16x16 icon to be used as the favicon | |
358 for an extension's pages. | |
359 The 16x16 icon is also displayed in the experimental extension | |
360 <a href="experimental.infobars.html">infobar</a> | |
361 feature. | |
362 </p> | |
363 <p> | |
364 Icons should generally be in PNG format, | |
365 because PNG has the best support for transparency. | |
366 They can, however, be in any format supported by WebKit, | |
367 including BMP, GIF, ICO, and JPEG. | |
368 Here's an example of specifying the icons: | |
369 </p> | |
370 <pre>"icons": { "16": "icon16.png", | |
371 "48": "icon48.png", | |
372 "128": "icon128.png" }, | |
373 </pre> | |
374 <p class="note"> | |
375 <b>Important:</b> | |
376 Use only the documented icon sizes. | |
377 <br><br> | |
378 You might notice that Chrome sometimes resizes these icons down to smaller | |
379 sizes. For example, the install dialog might shrink the 128-pixel | |
380 icon down to 69 pixels. | |
381 <br><br> | |
382 However, the details of | |
383 Chrome's UI may change between versions, and these changes assume that | |
384 developers are using the documented sizes. If you use other sizes, | |
385 your icon may look bad in future versions of the browser. | |
386 </p> | |
387 <p> | |
388 If you upload your extension, app, or theme using the | |
389 <a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Develope
r Dashboard</a>, | |
390 you'll need to upload additional images, | |
391 including at least one screenshot of your extension. | |
392 For more information, | |
393 see the | |
394 <a href="http://code.google.com/chrome/webstore/">Chrome Web Store | |
395 developer documentation</a>. | |
396 </p> | |
397 <h3 id="incognito">incognito</h3> | |
398 <p> | |
399 Either "spanning" or "split", to specify how this extension will | |
400 behave if allowed to run in incognito mode. | |
401 </p> | |
402 <p> | |
403 The default for extensions is "spanning", which means that the extension | |
404 will run in a single shared process. Any events or messages from an incognito | |
405 tab will be sent to the shared process, with an <em>incognito</em> flag | |
406 indicating where it came from. Because incognito tabs cannot use this shared | |
407 process, an extension using the "spanning" incognito mode will not be able to | |
408 load pages from its extension package into the main frame of an incognito tab. | |
409 </p> | |
410 <p> | |
411 The default for installable web apps is "split", | |
412 which means that all app pages in | |
413 an incognito window will run in their own incognito process. If the app or exten
sion contains a background page, that will also run in the incognito process. | |
414 This incognito process runs along side the regular process, but has a separate | |
415 memory-only cookie store. Each process sees events and messages only from its | |
416 own context (for example, the incognito process will see only incognito tab upda
tes). | |
417 The processes are unable to communicate with each other. | |
418 </p> | |
419 <p> | |
420 As a rule of thumb, if your extension or app needs to load a tab in an incognito
browser, use | |
421 <em>split</em> incognito behavior. If your extension or app needs to be logged | |
422 into a remote server or persist settings locally, use <em>spanning</em> | |
423 incognito behavior. | |
424 </p> | |
425 <h3 id="intents">intents</h3> | |
426 <p> | |
427 A dictionary that specifies all intent handlers provided by this extension or ap
p. Each key in the dictionary specifies an action verb that is handled by this e
xtension. The following example specifies two handlers for the action verb "<a h
ref="http://webintents.org/share">http://webintents.org/share</a>". | |
428 </p> | |
429 <pre>{ | |
430 "name": "test", | |
431 "version": "1", | |
432 "intents": { | |
433 "http://webintents.org/share": [ | |
434 { | |
435 "type": ["text/uri-list"], | |
436 "href": "/services/sharelink.html", | |
437 "title" : "Sample Link Sharing Intent", | |
438 "disposition" : "inline" | |
439 }, | |
440 { | |
441 "type": ["image/*"], | |
442 "href": "/services/shareimage.html", | |
443 "title" : "Sample Image Sharing Intent", | |
444 "disposition" : "window" | |
445 } | |
446 ] | |
447 } | |
448 } | |
449 </pre> | |
450 <p> | |
451 The value of "type" is an array of mime types that is supported by this handler.
The "href" indicates the URL of the page that handles the intent. For hosted ap
ps, these URLs must be within the allowed set of URLs. For extensions, all URLs
are inside the extension and considered relative to the extension root URL. | |
452 </p> | |
453 <p> | |
454 The "title" is displayed in the intent picker UI when the user initiates the act
ion specific to the handler. | |
455 </p> | |
456 <p> | |
457 The "disposition" is either "inline" or "window". Intents with "window" disposit
ion will open a new tab when invoked. Intents with "inline" disposition will be
displayed inside the intent picker when invoked. | |
458 </p> | |
459 <p> | |
460 For more information on intents, refer to the <a href="http://dvcs.w3.org/hg/web
-intents/raw-file/tip/spec/Overview.html">Web Intents specification</a> and <a h
ref="http://www.webintents.org">webintents.org</a>. | |
461 </p> | |
462 <h4>Handling content types via intents</h4> | |
463 <p> | |
464 Web Intents can be registered as content type viewers. To do that, the action ve
rb must be <a href="http://webintents.org/view">"http://webintents.org/view"</a>
, and the content type must be a white-listed MIME type. | |
465 </p> | |
466 <table> | |
467 <tbody><tr> | |
468 <th>Whitelisted MIME types</th> | |
469 </tr> | |
470 <tr><td>application/rss+xml</td></tr> | |
471 <tr><td>application/atom+xml</td></tr> | |
472 </tbody></table> | |
473 <h3 id="key">key</h3> | |
474 <p> | |
475 This value can be used to control | |
476 the unique ID of an extension, app, or theme when | |
477 it is loaded during development. | |
478 </p> | |
479 <p class="note"> | |
480 <b>Note:</b> You don't usually need to | |
481 use this value. Instead, write your | |
482 code so that the key value doesn't matter | |
483 by using <a href="overview.html#relative-urls">relative paths</a> | |
484 and <a href="extension.html#method-getURL">chrome.extension.getURL()</a>. | |
485 </p> | |
486 <p> | |
487 To get a suitable key value, first | |
488 install your extension from a <code>.crx</code> file | |
489 (you may need to | |
490 <a href="https://chrome.google.com/webstore/developer/dashboard">upload your ext
ension</a> | |
491 or <a href="packaging.html">package it manually</a>). | |
492 Then, in your | |
493 <a href="http://www.chromium.org/user-experience/user-data-directory">user | |
494 data directory</a>, look in the file | |
495 <code>Default/Extensions/<em><extensionId></em>/<em><versionString><
/em>/manifest.json</code>. | |
496 You will see the key value filled in there. | |
497 </p> | |
498 <h3 id="minimum_chrome_version">minimum_chrome_version</h3> | |
499 <p> | |
500 The version of Chrome that your extension, app, or theme requires, if any. | |
501 The format for this string is the same as for the | |
502 <a href="#version">version</a> field. | |
503 </p><h3 id="name">name</h3> | |
504 <p> | |
505 A short, plain text string | |
506 (no more than 45 characters) | |
507 that identifies the extension. | |
508 The name is used in the install dialog, | |
509 extension management UI, | |
510 and the <a href="https://chrome.google.com/webstore">store</a>. | |
511 You can specify locale-specific strings for this field; | |
512 see <a href="i18n.html">Internationalization</a> for details. | |
513 </p> | |
514 <h3 id="nacl_modules">nacl_modules</h3> | |
515 <p> | |
516 One or more mappings from MIME types to the Native Client module | |
517 that handles each type. | |
518 For example, the bold code in the following snippet | |
519 registers a Native Client module as the content handler | |
520 for the OpenOffice spreadsheet MIME type. | |
521 </p> | |
522 <pre>{ | |
523 "name": "Native Client OpenOffice Spreadsheet Viewer", | |
524 "version": "0.1", | |
525 "description": "Open OpenOffice spreadsheets, right in your browser.", | |
526 <b>"nacl_modules": [{ | |
527 "path": "OpenOfficeViewer.nmf", | |
528 "mime_type": "application/vnd.oasis.opendocument.spreadsheet" | |
529 }]</b> | |
530 } | |
531 </pre> | |
532 <p> | |
533 The value of "path" is the location of a Native Client manifest | |
534 (a <code>.nmf</code> file) | |
535 within the extension directory. | |
536 For more information on Native Client and <code>.nmf</code> files, see the | |
537 <a href="http://code.google.com/chrome/nativeclient/docs/technical_overview.html
">Native Client Technical Overview</a>. | |
538 </p> | |
539 <p> | |
540 Each MIME type can be associated with only one <code>.nmf</code> file, | |
541 but a single <code>.nmf</code> file might handle multiple MIME types. | |
542 The following example shows an extension | |
543 with two <code>.nmf</code> files | |
544 that handle three MIME types. | |
545 </p> | |
546 <pre>{ | |
547 "name": "Spreadsheet Viewer", | |
548 "version": "0.1", | |
549 "description": "Open OpenOffice and Excel spreadsheets, right in your browser.
", | |
550 "nacl_modules": [{ | |
551 "path": "OpenOfficeViewer.nmf", | |
552 "mime_type": "application/vnd.oasis.opendocument.spreadsheet" | |
553 }, | |
554 { | |
555 "path": "OpenOfficeViewer.nmf", | |
556 "mime_type": "application/vnd.oasis.opendocument.spreadsheet-template" | |
557 }, | |
558 { | |
559 "path": "ExcelViewer.nmf", | |
560 "mime_type": "application/excel" | |
561 }] | |
562 } | |
563 </pre> | |
564 <p class="note"> | |
565 <strong>Note:</strong> | |
566 You can use Native Client modules in extensions | |
567 without specifying "nacl_modules". | |
568 Use "nacl_modules" only if you want the browser | |
569 to use your Native Client module | |
570 to display a particular type of content. | |
571 </p> | |
572 <h3 id="offline_enabled">offline_enabled</h3> | |
573 <p> | |
574 Whether the app or extension is expected to work offline. When Chrome detects | |
575 that it is offline, apps with this field set to true will be highlighted | |
576 on the New Tab page. | |
577 </p> | |
578 <h3 id="permissions">permissions</h3> | |
579 <p> | |
580 An array of permissions that the extension or app might use. | |
581 Each permission can be either one of a list of known strings | |
582 (such as "geolocation") | |
583 or a match pattern | |
584 that gives access to one or more hosts. | |
585 Permissions can help to limit damage | |
586 if your extension or app is attacked. | |
587 Some permissions are also displayed to users before installation, | |
588 as detailed in | |
589 <a href="permission_warnings.html">Permission Warnings</a>. | |
590 </p> | |
591 <p> | |
592 If an extension API requires you to declare a permission in the manifest, | |
593 then its documentation tells you how to do so. | |
594 For example, | |
595 the <a href="tabs.html">Tabs</a> page | |
596 shows you how to | |
597 declare the "tabs" permission. | |
598 </p> | |
599 <p class="note"> | |
600 <b>Note:</b> | |
601 As of Chrome 16, some permissions can be optional. | |
602 For details, see | |
603 <a href="permissions.html">Optional Permissions</a>. | |
604 </p> | |
605 <p> | |
606 Here's an example of the permissions part of a manifest file | |
607 for an extension: | |
608 </p> | |
609 <pre>"permissions": [ | |
610 "tabs", | |
611 "bookmarks", | |
612 "http://www.blogger.com/", | |
613 "http://*.google.com/", | |
614 "unlimitedStorage" | |
615 ], | |
616 </pre> | |
617 <p> | |
618 The following table lists the permissions an extension | |
619 or packaged app can use. | |
620 </p> | |
621 <p class="note"> | |
622 <strong>Note:</strong> | |
623 Hosted apps can use the | |
624 "background", "clipboardRead", "clipboardWrite", "geolocation", "notifications", | |
625 and "unlimitedStorage" permissions, but not any other permissions listed in this | |
626 table. | |
627 </p> | |
628 <table> | |
629 <tbody><tr> | |
630 <th> Permission </th> <th> Description </th> | |
631 </tr> | |
632 <tr> | |
633 <td> <em>match pattern</em> </td> | |
634 <td> Specifies a <em>host permission</em>. | |
635 Required if the extension wants to interact | |
636 with the code running on pages. | |
637 Many extension capabilities, such as | |
638 <a href="xhr.html">cross-origin XMLHttpRequests</a>, | |
639 <a href="content_scripts.html#pi">programmatically injected | |
640 content scripts</a>, and <a href="cookies.html">the cookies API</a> | |
641 require host permissions. For details on the syntax, see | |
642 <a href="match_patterns.html">Match Patterns</a>. | |
643 </td> | |
644 </tr> | |
645 <tr id="bg"> | |
646 <td> "background" </td> | |
647 <td> <p> | |
648 Makes Chrome start up early and and shut down late, | |
649 so that apps and extensions can have a longer life. | |
650 </p> | |
651 <p> | |
652 When any installed hosted app, packaged app, or extension | |
653 has "background" permission, Chrome runs (invisibly) | |
654 as soon as the user logs into their computer—before | |
655 the user launches Chrome. | |
656 The "background" permission also makes Chrome continue running | |
657 (even after its last window is closed) | |
658 until the user explicitly quits Chrome. | |
659 </p> | |
660 <p class="note"> | |
661 <b>Note:</b> | |
662 Disabled apps and extensions | |
663 are treated as if they aren't installed. | |
664 </p> | |
665 <p> | |
666 You typically use the "background" permission with a | |
667 <a href="background_pages.html">background page</a> | |
668 or (for hosted apps) a | |
669 <a href="http://code.google.com/chrome/apps/docs/background.html">backgro
und window</a>. | |
670 </p> | |
671 </td> | |
672 </tr> | |
673 <tr> | |
674 <td> "bookmarks" </td> | |
675 <td> Required if the extension uses the | |
676 <a href="bookmarks.html">chrome.bookmarks</a> module. </td> | |
677 </tr> | |
678 <tr> | |
679 <td> "chrome://favicon/" </td> | |
680 <td> Required if the extension uses the | |
681 "chrome://favicon/<em>url</em>" mechanism | |
682 to display the favicon of a page. | |
683 For example, to display the favicon of http://www.google.com/, | |
684 you declare the "chrome://favicon/" permission | |
685 and use HTML code like this: | |
686 <pre><img src="chrome://favicon/http://www.google.com/"></pre> | |
687 </td> | |
688 </tr> | |
689 <tr> | |
690 <td> "clipboardRead" </td> | |
691 <td> Required if the extension uses | |
692 <code>document.execCommand('paste')</code>. </td> | |
693 </tr> | |
694 <tr> | |
695 <td> "clipboardWrite" </td> | |
696 <td> Indicates the app or extension uses | |
697 <code>document.execCommand('copy')</code> or | |
698 <code>document.execCommand('cut')</code>. This permission is <b>required | |
699 for hosted apps</b>; it's recommended for extensions and packaged apps. | |
700 </td> | |
701 </tr> | |
702 <tr> | |
703 <td> "contentSettings" </td> | |
704 <td> Required if the extension uses the | |
705 <a href="contentSettings.html">chrome.contentSettings</a> module. </td> | |
706 </tr> | |
707 <tr> | |
708 <td> "contextMenus" </td> | |
709 <td> Required if the extension uses the | |
710 <a href="contextMenus.html">chrome.contextMenus</a> module. </td> | |
711 </tr> | |
712 <tr> | |
713 <td> "cookies" </td> | |
714 <td> Required if the extension uses the | |
715 <a href="cookies.html">chrome.cookies</a> module. </td> | |
716 </tr> | |
717 <tr> | |
718 <td> "experimental" </td> | |
719 <td> Required if the extension uses any | |
720 <a href="http://code.google.com/chrome/extensions/dev/experimental.html">
chrome.experimental.* APIs</a>.</td> | |
721 </tr> | |
722 <tr> | |
723 <td id="fileBrowserHandler"> "fileBrowserHandler" </td> | |
724 <td> Required if the extension uses the | |
725 <a href="fileBrowserHandler.html">fileBrowserhandler</a> module. </td> | |
726 </tr> | |
727 <tr> | |
728 <td id="geolocation"> "geolocation" </td> | |
729 <td> Allows the extension to use the proposed HTML5 | |
730 <a href="http://dev.w3.org/geo/api/spec-source.html">geolocation API</a> | |
731 without prompting the user for permission. </td> | |
732 </tr> | |
733 <tr> | |
734 <td> "history" </td> | |
735 <td> Required if the extension uses the | |
736 <a href="history.html">chrome.history</a> module. </td> | |
737 </tr> | |
738 <tr> | |
739 <td> "idle" </td> | |
740 <td> Required if the extension uses the | |
741 <a href="idle.html">chrome.idle</a> module. </td> | |
742 </tr> | |
743 <tr> | |
744 <td> "management" </td> | |
745 <td> Required if the extension uses the | |
746 <a href="management.html">chrome.management</a> module. </td> | |
747 </tr> | |
748 <tr> | |
749 <td> "notifications" </td> | |
750 <td> Allows the extension to use the proposed HTML5 | |
751 <a href="http://www.chromium.org/developers/design-documents/desktop-noti
fications/api-specification">notification API</a> | |
752 without calling permission methods | |
753 (such as <code>checkPermission()</code>). | |
754 For more information see | |
755 <a href="notifications.html">Desktop Notifications</a>.</td> | |
756 </tr> | |
757 <tr> | |
758 <td> "privacy" </td> | |
759 <td> Required if the extension uses the | |
760 <a href="privacy.html">chrome.privacy</a> module. </td> | |
761 </tr> | |
762 <tr> | |
763 <td> "proxy" </td> | |
764 <td> Required if the extension uses the | |
765 <a href="proxy.html">chrome.proxy</a> module. </td> | |
766 </tr> | |
767 <tr> | |
768 <td> "tabs" </td> | |
769 <td> Required if the extension uses the | |
770 <a href="tabs.html">chrome.tabs</a> or | |
771 <a href="windows.html">chrome.windows</a> module. </td> | |
772 </tr> | |
773 <tr> | |
774 <td> "tts" </td> | |
775 <td> Required if the extension uses the | |
776 <a href="tts.html">chrome.tts</a> module. </td> | |
777 </tr> | |
778 <tr> | |
779 <td> "ttsEngine" </td> | |
780 <td> Required if the extension uses the | |
781 <a href="ttsEngine.html">chrome.ttsEngine</a> module. </td> | |
782 </tr> | |
783 <tr> | |
784 <td> "unlimitedStorage"</td> | |
785 <td> Provides an unlimited quota for storing HTML5 client-side data, | |
786 such as databases and local storage files. | |
787 Without this permission, the extension is limited to | |
788 5 MB of local storage. | |
789 <p class="note"> | |
790 <b>Note:</b> | |
791 This permission applies only to Web SQL Database and application cache | |
792 (see issue <a href="http://crbug.com/58985">58985</a>). | |
793 Also, it doesn't currently work with wildcard subdomains such as | |
794 <code>http://*.example.com</code>. | |
795 </p> | |
796 </td> | |
797 </tr><tr> | |
798 </tr><tr> | |
799 <td> "webNavigation" </td> | |
800 <td> Required if the extension uses the | |
801 <a href="webNavigation.html">chrome.webNavigation</a> module. </td> | |
802 </tr> | |
803 <tr> | |
804 <td> "webRequest" </td> | |
805 <td> Required if the extension uses the | |
806 <a href="webRequest.html">chrome.webRequest</a> module. </td> | |
807 </tr> | |
808 <tr> | |
809 <td> "webRequestBlocking" </td> | |
810 <td> Required if the extension uses the | |
811 <a href="webRequest.html">chrome.webRequest</a> module in a blocking | |
812 fashion. </td> | |
813 </tr> | |
814 </tbody></table> | |
815 <h3 id="requirements">requirements</h3> | |
816 <p> | |
817 Technologies required by the app or extension. | |
818 Hosting sites such as the Chrome Web Store may use this list | |
819 to dissuade users from installing apps or extensions | |
820 that will not work on their computer. | |
821 </p> | |
822 <p> | |
823 The only supported requirement is "3D", | |
824 which denotes GPU hardware acceleration. | |
825 For that requirement, | |
826 you can list the 3D-related features your app requires, | |
827 as demonstrated in the following example: | |
828 </p> | |
829 <pre>"requirements": { | |
830 "3D": { | |
831 "features": ["css3d", "webgl"] | |
832 } | |
833 } | |
834 </pre> | |
835 <p> | |
836 The "css3d" requirement refers to the | |
837 <a href="http://www.w3.org/TR/css3-3d-transforms/">CSS 3D Transforms specificati
on</a>, | |
838 and the "webgl" requirement refers to the | |
839 <a href="http://www.khronos.org/webgl/">WebGL API</a>. | |
840 For more information on Chrome 3D graphics support, | |
841 see the help article on | |
842 <a href="http://www.google.com/support/chrome/bin/answer.py?answer=1220892">WebG
L and 3D graphics</a>. | |
843 Support for additional requirements checks may be added in the future. | |
844 </p> | |
845 <h3 id="version">version</h3> | |
846 <p> | |
847 One to four dot-separated integers | |
848 identifying the version of this extension. | |
849 A couple of rules apply to the integers: | |
850 they must be between 0 and 65535, inclusive, | |
851 and non-zero integers can't start with 0. | |
852 For example, 99999 and 032 are both invalid. | |
853 </p> | |
854 <p> | |
855 Here are some examples of valid versions: | |
856 </p> | |
857 <ul> | |
858 <li> <code>"version": "1"</code> </li> | |
859 <li> <code>"version": "1.0"</code> </li> | |
860 <li> <code>"version": "2.10.2"</code> </li> | |
861 <li> <code>"version": "3.1.2.4567"</code> </li> | |
862 </ul> | |
863 <p> | |
864 The autoupdate system compares versions | |
865 to determine whether an installed extension | |
866 needs to be updated. | |
867 If the published extension has a newer version string | |
868 than the installed extension, | |
869 then the extension is automatically updated. | |
870 </p> | |
871 <p> | |
872 The comparison starts with the leftmost integers. | |
873 If those integers are equal, | |
874 the integers to the right are compared, | |
875 and so on. | |
876 For example, 1.2.0 is a newer version than 1.1.9.9999. | |
877 </p> | |
878 <p> | |
879 A missing integer is equal to zero. | |
880 For example, 1.1.9.9999 is newer than 1.1. | |
881 </p> | |
882 <p> | |
883 For more information, see | |
884 <a href="autoupdate.html">Autoupdating</a>. | |
885 </p> | |
886 <!-- [PENDING: Possibly: point to the store/dashboard and make a big deal of the
fact that autoupdating is free if you use them.] --> | |
887 <h3 id="manifest_version">manifest_version</h3> | |
888 <p> | |
889 One integer specifying the version of the manifest file format your package | |
890 requires. As of Chrome 18, developers <em>should</em> specify <code>2</code> | |
891 (without quotes) to use the format as described by this document: | |
892 </p> | |
893 <pre>"manifest_version": 2</pre> | |
894 <p> | |
895 Consider manifest version 1 <em>deprecated</em> as of Chrome 18. Version 2 is | |
896 not yet <em>required</em>, but we will, at some point in the not-too-distant | |
897 future, stop supporting packages using deprecated manifest versions. Extensions, | |
898 applications, and themes that aren't ready to make the jump to the new manifest | |
899 version in Chrome 18 can either explicitly specify version <code>1</code>, or | |
900 leave the key off entirely. | |
901 </p> | |
902 <p> | |
903 The changes between version 1 and version 2 of the manifest file format are | |
904 described in detail in <a href="manifestVersion.html">the | |
905 <code>manifest_version</code> documentation.</a> | |
906 </p> | |
907 <p class="caution"> | |
908 Setting <code>manifest_version</code> 2 in Chrome 17 or lower is not | |
909 recommended. If your extension needs to work in older versions of Chrome, | |
910 stick with version 1 for the moment. We'll give you ample warning before | |
911 version 1 stops working. | |
912 </p> | |
913 <h3 id="web_accessible_resources">web_accessible_resources</h3> | |
914 <p> | |
915 An array of strings specifying the paths (relative to the package root) of | |
916 packaged resources that are expected to be usable in the context of a web page. | |
917 For example, an extension that injects a content script with the intention of | |
918 building up some custom interface for <code>example.com</code> would whitelist | |
919 any resources that interface requires (images, icons, stylesheets, scripts, | |
920 etc.) as follows: | |
921 </p> | |
922 <pre>{ | |
923 ... | |
924 "web_accessible_resources": [ | |
925 "images/my-awesome-image1.png", | |
926 "images/my-amazing-icon1.png", | |
927 "style/double-rainbow.css", | |
928 "script/double-rainbow.js" | |
929 ], | |
930 ... | |
931 }</pre> | |
932 <p> | |
933 These resources would then be available in a webpage via the URL | |
934 <code>chrome-extension://[PACKAGE ID]/[PATH]</code>, which can be generated with | |
935 the <a href="extension.html#method-getURL"> | |
936 <code>chrome.extension.getURL</code> | |
937 </a> method. Whitelisted resources are served with appropriate | |
938 <a href="http://www.w3.org/TR/cors/">CORS</a> headers, so they're available via | |
939 mechanisms like XHR. | |
940 </p> | |
941 <p> | |
942 Injected content scripts themselves do not need to be whitelisted. | |
943 </p> | |
944 <h4>Default Availability</h4> | |
945 <p> | |
946 Resources inside of packages using <a href="#manifest_version"><code>manifest_ve
rsion</code></a> | |
947 2 or above are <strong>blocked by default</strong>, and must be whitelisted | |
948 for use via this property. | |
949 </p> | |
950 <p> | |
951 Resources inside of packages using <code>manifest_version</code> 1 are available | |
952 by default, but <em>if</em> you do set this property, then it will be treated as | |
953 a complete list of all whitelisted resources. Resources not listed will be | |
954 blocked. | |
955 </p> | |
956 <h3 id="sandbox">sandbox</h3> | |
957 <p> | |
958 Defines an collection of app or extension pages that are to be served | |
959 in a sandboxed unique origin, and optionally a Content Security Policy to use | |
960 with them. Being in a sandbox has two implications: | |
961 </p> | |
962 <ol> | |
963 <li>A sandboxed page will not have access to extension or app APIs, or | |
964 direct access to non-sandboxed pages (it may communicate with them via | |
965 <code>postMessage()</code>).</li> | |
966 <li>A sandboxed page is not subject to the | |
967 <a href="contentSecurityPolicy.html">Content Security Policy (CSP)</a> used | |
968 by the rest of the app or extension (it has its own separate CSP value). This | |
969 means that, for example, it can use inline script and <code>eval</code>.</li> | |
970 </ol> | |
971 <p>For example, here's how to specify that two extension pages are to be served | |
972 in a sandbox with a custom CSP:</p> | |
973 <pre>{ | |
974 ... | |
975 "sandbox": { | |
976 "pages": [ | |
977 "page1.html", | |
978 "directory/page2.html" | |
979 ] | |
980 <i>// content_security_policy is optional.</i> | |
981 "content_security_policy": | |
982 "sandbox allow-scripts; script-src https://www.google.com" | |
983 ], | |
984 ... | |
985 }</pre> | |
986 <p> | |
987 If not specified, the default <code>content_security_policy</code> value is | |
988 <code>sandbox allow-scripts allow-forms</code>. You can specify your CSP | |
989 value to restrict the sandbox even further, but it must have the <code>sandbox</
code> | |
990 directive and may not have the <code>allow-same-origin</code> token (see | |
991 <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-
element.html#attr-iframe-sandbox">the | |
992 HTML5 specification</a> for possible sandbox tokens). | |
993 </p> | |
994 <p> | |
995 Note that you only need to list pages that you expected to be loaded in | |
996 windows or frames. Resources used by sandboxed pages (e.g. stylesheets or | |
997 JavaScript source files) do not need to appear in the | |
998 <code>sandboxed_page</code> list, they will use the sandbox of the page | |
999 that embeds them. | |
1000 </p> | |
1001 <p> | |
1002 Sandboxed page may only be specified when using | |
1003 <a href="#manifest_version"><code>manifest_version</code></a> 2 or above. | |
1004 </p> | |
1005 </div> | |
1006 <!-- API PAGE --> | |
1007 <!-- /apiPage --> | |
1008 </div> <!-- /gc-pagecontent --> | |
1009 </div> <!-- /g-section --> | |
1010 </div> <!-- /codesiteContent --> | |
1011 <div id="gc-footer" --=""> | |
1012 <div class="text"> | |
1013 <p> | |
1014 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
1015 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
1016 Attribution 3.0 License</a>, and code samples are licensed under the | |
1017 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
1018 </p> | |
1019 <p> | |
1020 ©2011 Google | |
1021 </p> | |
1022 <!-- begin analytics --> | |
1023 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
1024 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
1025 <script type="text/javascript"> | |
1026 // chrome doc tracking | |
1027 try { | |
1028 var engdocs = _gat._getTracker("YT-10763712-2"); | |
1029 engdocs._trackPageview(); | |
1030 } catch(err) {} | |
1031 // code.google.com site-wide tracking | |
1032 try { | |
1033 _uacct="UA-18071-1"; | |
1034 _uanchor=1; | |
1035 _uff=0; | |
1036 urchinTracker(); | |
1037 } | |
1038 catch(e) {/* urchinTracker not available. */} | |
1039 </script> | |
1040 <!-- end analytics --> | |
1041 </div> | |
1042 </div> <!-- /gc-footer --> | |
1043 </div> <!-- /gc-container --> | |
1044 </body></html> | |
OLD | NEW |