OLD | NEW |
---|---|
1 <div id="pageData-name" class="pageData">Formats: Manifest Files</div> | 1 <div id="pageData-name" class="pageData">Formats: Manifest Files</div> |
2 <div id="pageData-showTOC" class="pageData">true</div> | 2 <div id="pageData-showTOC" class="pageData">true</div> |
3 | 3 |
4 <p> | 4 <p> |
5 Every extension has a | 5 Every extension, installable web app, and theme has a |
6 <a href="http://www.json.org">JSON</a>-formatted manifest file, | 6 <a href="http://www.json.org">JSON</a>-formatted manifest file, |
7 named <code>manifest.json</code>, | 7 named <code>manifest.json</code>, |
8 that provides important information about the extension. | 8 that provides important information. |
9 </p> | 9 </p> |
10 | 10 |
11 <h2 id="overview"> Field summary </h2> | 11 <h2 id="overview"> Field summary </h2> |
12 | 12 |
13 <p> | 13 <p> |
14 The following code shows the supported manifest fields, | 14 The following code shows the supported manifest fields, |
15 with links to the page that discusses each field. | 15 with links to the page that discusses each field. |
16 The only fields that are required for every extension | 16 The only fields that are always required |
17 are <b>name</b> and <b>version</b>. | 17 are <b>name</b> and <b>version</b>. |
18 </p> | 18 </p> |
19 | 19 |
20 <pre> | 20 <pre> |
21 { | 21 { |
22 <em>// Required</em> | 22 <em>// Required</em> |
23 "<a href="#name">name</a>": "<em>My Extension</em>", | 23 "<a href="#name">name</a>": "<em>My Extension</em>", |
24 "<a href="#version">version</a>": "<em>versionString</em>", | 24 "<a href="#version">version</a>": "<em>versionString</em>", |
25 | 25 |
26 <em>// Recommended</em> | 26 <em>// Recommended</em> |
27 "<a href="#description">description</a>": "<em>A plain text description</em>", | 27 "<a href="#description">description</a>": "<em>A plain text description</em>", |
28 "<a href="#icons">icons</a>": { ... }, | 28 "<a href="#icons">icons</a>": { ... }, |
29 "<a href="#default_locale">default_locale</a>": "<em>en</em>", | 29 "<a href="#default_locale">default_locale</a>": "<em>en</em>", |
30 | 30 |
31 <em>// Pick one (or none)</em> | 31 <em>// Pick one (or none)</em> |
32 "<a href="browserAction.html">browser_action</a>": {...}, | 32 "<a href="browserAction.html">browser_action</a>": {...}, |
33 "<a href="pageAction.html">page_action</a>": {...}, | 33 "<a href="pageAction.html">page_action</a>": {...}, |
34 "<a href="themes.html">theme</a>": {...}, | 34 "<a href="themes.html">theme</a>": {...}, |
35 "<a href="#app">app</a>": {...}, | |
35 | 36 |
36 <em>// Add any of these that you need</em> | 37 <em>// Add any of these that you need</em> |
37 "<a href="background_pages.html">background_page</a>": "<em>aFile</em>.html", | 38 "<a href="background_pages.html">background_page</a>": "<em>aFile</em>.html", |
38 "<a href="override.html">chrome_url_overrides</a>": {...}, | 39 "<a href="override.html">chrome_url_overrides</a>": {...}, |
39 "<a href="content_scripts.html">content_scripts</a>": [...], | 40 "<a href="content_scripts.html">content_scripts</a>": [...], |
40 "<a href="#homepage_url">homepage_url</a>": "http://<em>path/to/homepage</em>" , | 41 "<a href="#homepage_url">homepage_url</a>": "http://<em>path/to/homepage</em>" , |
41 "<a href="#incognito">incognito</a>": "spanning" <em>or</em> "split", | 42 "<a href="#incognito">incognito</a>": "spanning" <em>or</em> "split", |
42 "<a href="#key">key</a>": "<em>publicKey</em>", | 43 "<a href="#key">key</a>": "<em>publicKey</em>", |
43 "<a href="#minimum_chrome_version">minimum_chrome_version</a>": "<em>versionSt ring</em>", | 44 "<a href="#minimum_chrome_version">minimum_chrome_version</a>": "<em>versionSt ring</em>", |
44 "<a href="omnibox.html">omnibox</a>": { "keyword" : "<em>aString</em>" }, | 45 "<a href="omnibox.html">omnibox</a>": { "keyword" : "<em>aString</em>" }, |
45 "<a href="options.html">options_page</a>": "<em>aFile</em>.html", | 46 "<a href="options.html">options_page</a>": "<em>aFile</em>.html", |
46 "<a href="#permissions">permissions</a>": [...], | 47 "<a href="#permissions">permissions</a>": [...], |
47 "<a href="npapi.html">plugins</a>": [...], | 48 "<a href="npapi.html">plugins</a>": [...], |
48 "<a href="autoupdate.html">update_url</a>": "http://<em>path/to/updateInfo</em >.xml" | 49 "<a href="autoupdate.html">update_url</a>": "http://<em>path/to/updateInfo</em >.xml" |
49 } | 50 } |
50 </pre> | 51 </pre> |
51 | 52 |
52 | 53 |
53 <h2>Field details</h2> | 54 <h2>Field details</h2> |
54 | 55 |
55 <p> | 56 <p> |
56 This section covers fields that aren't described in another page. | 57 This section covers fields that aren't described in another page. |
57 For a complete list of fields, | 58 For a complete list of fields, |
58 with links to where they're described in detail, | 59 with links to where they're described in detail, |
59 see the <a href="#overview">Field summary</a>. | 60 see the <a href="#overview">Field summary</a>. |
60 </p> | 61 </p> |
61 | 62 |
63 | |
64 <h3 id="app">app</h3> | |
65 | |
66 <p> | |
67 Used by installable web apps, | |
68 including packaged apps, | |
69 to specify the URLs that the app uses. | |
70 Most important is the <em>launch page</em> for the app—the | |
71 page that the browser goes to when the user clicks the app's icon | |
72 in the New Tab page. | |
73 </p> | |
74 | |
75 <p> | |
76 For details, see the documentation for | |
77 <a href="http://code.google.com/chrome/apps/docs/developers_guide.html">hosted a pps</a> and | |
78 <a href="apps.html">packaged apps</a>. | |
79 </p> | |
80 | |
62 <h3 id="default_locale">default_locale</h3> | 81 <h3 id="default_locale">default_locale</h3> |
63 | 82 |
64 <p> | 83 <p> |
65 Specifies the subdirectory of <code>_locales</code> | 84 Specifies the subdirectory of <code>_locales</code> |
66 that contains the default strings for this extension. | 85 that contains the default strings for this extension. |
67 This field is <b>required</b> in extensions | 86 This field is <b>required</b> in extensions |
68 that have a <code>_locales</code> directory; | 87 that have a <code>_locales</code> directory; |
69 it <b>must be absent</b> in extensions | 88 it <b>must be absent</b> in extensions |
70 that have no <code>_locales</code> directory. | 89 that have no <code>_locales</code> directory. |
71 For details, see | 90 For details, see |
(...skipping 20 matching lines...) Expand all Loading... | |
92 The URL of the homepage for this extension. The extensions management page (chro me://extensions) | 111 The URL of the homepage for this extension. The extensions management page (chro me://extensions) |
93 will contain a link to this URL. This field is particularly useful if you | 112 will contain a link to this URL. This field is particularly useful if you |
94 <a href="hosting.html">host the extension on your own site</a>. If you distribut e your | 113 <a href="hosting.html">host the extension on your own site</a>. If you distribut e your |
95 extension using the <a href="http://chrome.google.com/extensions">gallery</a>, | 114 extension using the <a href="http://chrome.google.com/extensions">gallery</a>, |
96 the homepage URL defaults to the extension's own gallery page. | 115 the homepage URL defaults to the extension's own gallery page. |
97 </p> | 116 </p> |
98 | 117 |
99 <h3 id="icons">icons</h3> | 118 <h3 id="icons">icons</h3> |
100 | 119 |
101 <p> | 120 <p> |
102 One or more icons that represent the extension. | 121 One or more icons that represent the extension, app, or theme. |
103 You should provide icons in at least two sizes — | 122 You should always provide a 128x128 icon; |
104 48x48 and 128x128 pixels. | 123 it's used during installation and by the Chrome Web Store. |
105 The 48x48 icon is used in the extensions management page | 124 Extensions should also provide a 48x48 icon, |
125 which is used in the extensions management page | |
106 (chrome://extensions). | 126 (chrome://extensions). |
107 The 128x128 icon is used when the user installs the extension. | |
108 You can also specify a 16x16 icon to be used as the favicon | 127 You can also specify a 16x16 icon to be used as the favicon |
109 for the extension's pages. | 128 for an extension's pages. |
110 The 16x16 icon is also displayed in the experimental | 129 The 16x16 icon is also displayed in the experimental extension |
111 <a href="experimental.infobars.html">infobar</a> | 130 <a href="experimental.infobars.html">infobar</a> |
112 feature. | 131 feature. |
113 </p> | 132 </p> |
114 | 133 |
115 <p> | 134 <p> |
116 Icons should generally be in PNG format, | 135 Icons should generally be in PNG format, |
117 because PNG has the best support for transparency. | 136 because PNG has the best support for transparency. |
118 They can, however, be in any format supported by WebKit, | 137 They can, however, be in any format supported by WebKit, |
119 including BMP, GIF, ICO, and JPEG. | 138 including BMP, GIF, ICO, and JPEG. |
120 Here's an example of specifying the icons: | 139 Here's an example of specifying the icons: |
121 </p> | 140 </p> |
122 | 141 |
123 <pre> | 142 <pre> |
124 "icons": { "16": "icon16.png", | 143 "icons": { "16": "icon16.png", |
125 "48": "icon48.png", | 144 "48": "icon48.png", |
126 "128": "icon128.png" }, | 145 "128": "icon128.png" }, |
127 </pre> | 146 </pre> |
128 | 147 |
129 <p class="note"> | 148 <p class="note"> |
130 <b>Note:</b> | 149 <b>Important:</b> |
131 Use only the documented icon sizes. | 150 Use only the documented icon sizes. |
132 <br><br> | 151 <br><br> |
133 You may notice that Google Chrome sometimes resizes these icons down to smaller | 152 You might notice that Chrome sometimes resizes these icons down to smaller |
134 sizes. For example, as of this writing, the install dialog shrinks the 128-pixel | 153 sizes. For example, the install dialog might shrink the 128-pixel |
135 icon down to 69 pixels. | 154 icon down to 69 pixels. |
136 <br><br> | 155 <br><br> |
137 Nevertheless, you should use only the documented sizes. The details of Google | 156 However, the details of |
138 Chrome's UI may change between versions. These changes are made assuming that | 157 Chrome's UI may change between versions, and these changes assume that |
139 extension developers are using the documented sizes. If you use other sizes, | 158 developers are using the documented sizes. If you use other sizes, |
140 your icon may look bad in future versions of the browser. | 159 your icon may look bad in future versions of the browser. |
141 </p> | 160 </p> |
142 | 161 |
143 <p> | 162 <p> |
144 If you submit your extension to the | 163 If you upload your extension, app, or theme using the |
145 <a href="https://chrome.google.com/extensions">gallery</a>, | 164 <a href="https://chrome.google.com/extensions/developer/dashboard">Chrome Develo per Dashboard</a>, |
146 you'll need to upload additional images, | 165 you'll need to upload additional images, |
147 including a 32x32-pixel logo | 166 including at least one screenshot of your extension. |
148 and at least one screenshot of your extension. | 167 For more information, |
149 For more information on gallery requirements, | |
150 see the | 168 see the |
151 <a href="http://www.google.com/support/chrome/bin/answer.py?answer=113909">galle ry help</a>. | 169 <a href="http://code.google.com/chrome/webstore/">Chrome Web Store |
170 developer documentation</a>. | |
152 </p> | 171 </p> |
153 | 172 |
154 <h3 id="incognito">incognito</h3> | 173 <h3 id="incognito">incognito</h3> |
155 | 174 |
156 <p> | 175 <p> |
157 Either "spanning" or "split", to specify how this extension will | 176 Either "spanning" or "split", to specify how this extension will |
158 behave if allowed to run in incognito mode. | 177 behave if allowed to run in incognito mode. |
159 </p> | 178 </p> |
160 | 179 |
161 <p> | 180 <p> |
(...skipping 17 matching lines...) Expand all Loading... | |
179 As a rule of thumb, if your extension or app needs to load a tab in an incognito browser, use | 198 As a rule of thumb, if your extension or app needs to load a tab in an incognito browser, use |
180 <em>split</em> incognito behavior. If your extension or app needs to be logged | 199 <em>split</em> incognito behavior. If your extension or app needs to be logged |
181 into a remote server or persist settings locally, use <em>spanning</em> | 200 into a remote server or persist settings locally, use <em>spanning</em> |
182 incognito behavior. | 201 incognito behavior. |
183 </p> | 202 </p> |
184 | 203 |
185 <h3 id="key">key</h3> | 204 <h3 id="key">key</h3> |
186 | 205 |
187 <p> | 206 <p> |
188 This value can be used to control | 207 This value can be used to control |
189 the unique ID of an extension when | 208 the unique ID of an extension, app, or theme when |
190 it is loaded during development. | 209 it is loaded during development. |
191 </p> | 210 </p> |
192 | 211 |
193 <p class="note"> | 212 <p class="note"> |
194 <b>Note:</b> Most extensions should not need to | 213 <b>Note:</b> You don't usually need to |
195 use this value. Instead, write your | 214 use this value. Instead, write your |
196 code so that the key value doesn't matter | 215 code so that the key value doesn't matter |
197 by using <a href="overview.html#relative-urls">relative paths</a> | 216 by using <a href="overview.html#relative-urls">relative paths</a> |
198 and <a href="extension.html#method-getURL">chrome.extension.getURL()</a>. | 217 and <a href="extension.html#method-getURL">chrome.extension.getURL()</a>. |
199 </p> | 218 </p> |
200 | 219 |
201 <p> | 220 <p> |
202 To get a suitable key value, first | 221 To get a suitable key value, first |
203 install your extension from a <code>.crx</code> file | 222 install your extension from a <code>.crx</code> file |
204 (you may need to | 223 (you may need to |
205 <a href="hosting.html#gallery">upload your extension to the gallery</a>, | 224 <a href="https://chrome.google.com/webstore/developer/dashboard">upload your ext ension</a> |
206 or <a href="packaging.html">package it manually</a>). | 225 or <a href="packaging.html">package it manually</a>). |
207 Then, in your | 226 Then, in your |
208 <a href="http://www.chromium.org/user-experience/user-data-directory">user | 227 <a href="http://www.chromium.org/user-experience/user-data-directory">user |
209 data directory</a>, look in the file | 228 data directory</a>, look in the file |
210 <code>Default/Extensions/<em><extensionId></em>/<em><versionString>< /em>/manifest.json</code>. | 229 <code>Default/Extensions/<em><extensionId></em>/<em><versionString>< /em>/manifest.json</code>. |
211 You will see the key value filled in there. | 230 You will see the key value filled in there. |
212 </p> | 231 </p> |
213 | 232 |
214 <h3 id="minimum_chrome_version">minimum_chrome_version</h3> | 233 <h3 id="minimum_chrome_version">minimum_chrome_version</h3> |
215 | 234 |
216 <p> | 235 <p> |
217 The version of Google Chrome that your extension requires, if any. | 236 The version of Chrome that your extension, app, or theme requires, if any. |
218 The format for this string is the same as for the | 237 The format for this string is the same as for the |
219 <a href="#version">version</a> field. | 238 <a href="#version">version</a> field. |
220 | 239 |
221 <h3 id="name">name</h3> | 240 <h3 id="name">name</h3> |
222 | 241 |
223 <p> | 242 <p> |
224 A short, plain text string | 243 A short, plain text string |
225 (no more than 45 characters) | 244 (no more than 45 characters) |
226 that identifies the extension. | 245 that identifies the extension. |
227 The name is used in the install dialog, | 246 The name is used in the install dialog, |
228 extension management UI, | 247 extension management UI, |
229 and the <a href="https://chrome.google.com/extensions">extension gallery</a>. | 248 and the <a href="https://chrome.google.com/extensions">extension gallery</a>. |
230 You can specify locale-specific strings for this field; | 249 You can specify locale-specific strings for this field; |
231 see <a href="i18n.html">Internationalization</a> for details. | 250 see <a href="i18n.html">Internationalization</a> for details. |
232 </p> | 251 </p> |
233 | 252 |
234 <h3 id="permissions">permissions</h3> | 253 <h3 id="permissions">permissions</h3> |
235 | 254 |
236 <p> | 255 <p> |
237 An array of permissions that the extension might use. | 256 An array of permissions that the extension or app might use. |
238 Each permission can be either one of a list of known strings | 257 Each permission can be either one of a list of known strings |
239 (such as "tabs") | 258 (such as "geolocation") |
240 or a match pattern | 259 or a match pattern |
241 that gives access to one or more hosts. | 260 that gives access to one or more hosts. |
242 These permissions are displayed to users before installation. | 261 Permissions can help to limit damage |
243 Permissions might also help to limit damage | 262 if your extension or app is attacked. |
244 if your extension is attacked. | 263 Some permissions are also displayed to users before installation, |
264 as detailed in | |
265 <a href="permission_warnings.html">Permission Warnings</a>. | |
245 </p> | 266 </p> |
246 | 267 |
247 <p> | 268 <p> |
248 If an API requires you to declare a permission in the manifest, | 269 If an extension API requires you to declare a permission in the manifest, |
249 then its documentation tells you how to do so. | 270 then its documentation tells you how to do so. |
250 For example, | 271 For example, |
251 the <a href="tabs.html">Tabs</a> page | 272 the <a href="tabs.html">Tabs</a> page |
252 shows you how to | 273 shows you how to |
253 declare the "tabs" permission. | 274 declare the "tabs" permission. |
254 </p> | 275 </p> |
255 | 276 |
256 <p> | 277 <p> |
257 Here's an example of the permissions part of a manifest file: | 278 Here's an example of the permissions part of a manifest file |
279 for an extension: | |
258 </p> | 280 </p> |
259 | 281 |
260 <pre> | 282 <pre> |
261 "permissions": [ | 283 "permissions": [ |
262 "tabs", | 284 "tabs", |
263 "bookmarks", | 285 "bookmarks", |
264 "http://www.blogger.com/", | 286 "http://www.blogger.com/", |
265 "http://*.google.com/", | 287 "http://*.google.com/", |
266 "unlimitedStorage" | 288 "unlimitedStorage" |
267 ], | 289 ], |
268 </pre> | 290 </pre> |
269 | 291 |
270 <p> | 292 <p> |
271 The following table lists the permissions an extension can use. | 293 The following table lists the permissions an extension |
294 or packaged app can use. | |
295 </p> | |
296 | |
297 <p class="note"> | |
298 <strong>Note:</strong> | |
299 Hosted apps can use only HTML5-related permissions | |
kurrik.chromium
2010/12/07 05:16:30
HTML5-related is a bit confusing. "Web-related"?
kathyw
2010/12/07 06:43:32
I've changed it. Take another look?
| |
300 such as "geolocation", "notifications", and "unlimitedStorage". | |
272 </p> | 301 </p> |
273 | 302 |
274 <table> | 303 <table> |
275 <tr> | 304 <tr> |
276 <th> Permission </th> <th> Description </th> | 305 <th> Permission </th> <th> Description </th> |
277 </tr> | 306 </tr> |
278 <tr> | 307 <tr> |
279 <td> <em>match pattern</em> </td> | 308 <td> <em>match pattern</em> </td> |
280 <td> Specifies a <em>host permission</em>. | 309 <td> Specifies a <em>host permission</em>. |
281 Required if the extension wants to interact | 310 Required if the extension wants to interact |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 A missing integer is equal to zero. | 446 A missing integer is equal to zero. |
418 For example, 1.1.9.9999 is newer than 1.1. | 447 For example, 1.1.9.9999 is newer than 1.1. |
419 </p> | 448 </p> |
420 | 449 |
421 <p> | 450 <p> |
422 For more information, see | 451 For more information, see |
423 <a href="autoupdate.html">Autoupdating</a>. | 452 <a href="autoupdate.html">Autoupdating</a>. |
424 </p> | 453 </p> |
425 | 454 |
426 <!-- [PENDING: Possibly: point to the gallery and make a big deal of the fact th at autoupdating is free if you use the gallery.] --> | 455 <!-- [PENDING: Possibly: point to the gallery and make a big deal of the fact th at autoupdating is free if you use the gallery.] --> |
OLD | NEW |