| 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 |
| 72 <a href="i18n.html">Internationalization</a>. | 91 <a href="i18n.html">Internationalization</a>. |
| 73 </p> | 92 </p> |
| 74 | 93 |
| 75 <h3 id="description">description</h3> | 94 <h3 id="description">description</h3> |
| 76 | 95 |
| 77 <p> | 96 <p> |
| 78 A plain text string | 97 A plain text string |
| 79 (no HTML or other formatting; | 98 (no HTML or other formatting; |
| 80 no more than 132 characters) | 99 no more than 132 characters) |
| 81 that describes the extension. | 100 that describes the extension. |
| 82 The description should be suitable for both | 101 The description should be suitable for both |
| 83 the browser's extension management UI | 102 the browser's extension management UI |
| 84 and the <a href="https://chrome.google.com/extensions">extension gallery</a>. | 103 and the <a href="https://chrome.google.com/webstore">Chrome Web Store</a>. |
| 85 You can specify locale-specific strings for this field; | 104 You can specify locale-specific strings for this field; |
| 86 see <a href="i18n.html">Internationalization</a> for details. | 105 see <a href="i18n.html">Internationalization</a> for details. |
| 87 </p> | 106 </p> |
| 88 | 107 |
| 89 <h3 id="homepage_url">homepage_url</h3> | 108 <h3 id="homepage_url">homepage_url</h3> |
| 90 | 109 |
| 91 <p> | 110 <p> |
| 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="https://chrome.google.com/extensions">Extensions Ga
llery</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. |
| 116 <!-- PENDING: check whether the same is true of the store --> |
| 97 </p> | 117 </p> |
| 98 | 118 |
| 99 <h3 id="icons">icons</h3> | 119 <h3 id="icons">icons</h3> |
| 100 | 120 |
| 101 <p> | 121 <p> |
| 102 One or more icons that represent the extension. | 122 One or more icons that represent the extension, app, or theme. |
| 103 You should provide icons in at least two sizes — | 123 You should always provide a 128x128 icon; |
| 104 48x48 and 128x128 pixels. | 124 it's used during installation and by the Chrome Web Store. |
| 105 The 48x48 icon is used in the extensions management page | 125 Extensions should also provide a 48x48 icon, |
| 126 which is used in the extensions management page |
| 106 (chrome://extensions). | 127 (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 | 128 You can also specify a 16x16 icon to be used as the favicon |
| 109 for the extension's pages. | 129 for an extension's pages. |
| 110 The 16x16 icon is also displayed in the experimental | 130 The 16x16 icon is also displayed in the experimental extension |
| 111 <a href="experimental.infobars.html">infobar</a> | 131 <a href="experimental.infobars.html">infobar</a> |
| 112 feature. | 132 feature. |
| 113 </p> | 133 </p> |
| 114 | 134 |
| 115 <p> | 135 <p> |
| 116 Icons should generally be in PNG format, | 136 Icons should generally be in PNG format, |
| 117 because PNG has the best support for transparency. | 137 because PNG has the best support for transparency. |
| 118 They can, however, be in any format supported by WebKit, | 138 They can, however, be in any format supported by WebKit, |
| 119 including BMP, GIF, ICO, and JPEG. | 139 including BMP, GIF, ICO, and JPEG. |
| 120 Here's an example of specifying the icons: | 140 Here's an example of specifying the icons: |
| 121 </p> | 141 </p> |
| 122 | 142 |
| 123 <pre> | 143 <pre> |
| 124 "icons": { "16": "icon16.png", | 144 "icons": { "16": "icon16.png", |
| 125 "48": "icon48.png", | 145 "48": "icon48.png", |
| 126 "128": "icon128.png" }, | 146 "128": "icon128.png" }, |
| 127 </pre> | 147 </pre> |
| 128 | 148 |
| 129 <p class="note"> | 149 <p class="note"> |
| 130 <b>Note:</b> | 150 <b>Important:</b> |
| 131 Use only the documented icon sizes. | 151 Use only the documented icon sizes. |
| 132 <br><br> | 152 <br><br> |
| 133 You may notice that Google Chrome sometimes resizes these icons down to smaller | 153 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 | 154 sizes. For example, the install dialog might shrink the 128-pixel |
| 135 icon down to 69 pixels. | 155 icon down to 69 pixels. |
| 136 <br><br> | 156 <br><br> |
| 137 Nevertheless, you should use only the documented sizes. The details of Google | 157 However, the details of |
| 138 Chrome's UI may change between versions. These changes are made assuming that | 158 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, | 159 developers are using the documented sizes. If you use other sizes, |
| 140 your icon may look bad in future versions of the browser. | 160 your icon may look bad in future versions of the browser. |
| 141 </p> | 161 </p> |
| 142 | 162 |
| 143 <p> | 163 <p> |
| 144 If you submit your extension to the | 164 If you upload your extension, app, or theme using the |
| 145 <a href="https://chrome.google.com/extensions">gallery</a>, | 165 <a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Develope
r Dashboard</a>, |
| 146 you'll need to upload additional images, | 166 you'll need to upload additional images, |
| 147 including a 32x32-pixel logo | 167 including at least one screenshot of your extension. |
| 148 and at least one screenshot of your extension. | 168 For more information, |
| 149 For more information on gallery requirements, | |
| 150 see the | 169 see the |
| 151 <a href="http://www.google.com/support/chrome/bin/answer.py?answer=113909">galle
ry help</a>. | 170 <a href="http://code.google.com/chrome/webstore/">Chrome Web Store |
| 171 developer documentation</a>. |
| 152 </p> | 172 </p> |
| 153 | 173 |
| 154 <h3 id="incognito">incognito</h3> | 174 <h3 id="incognito">incognito</h3> |
| 155 | 175 |
| 156 <p> | 176 <p> |
| 157 Either "spanning" or "split", to specify how this extension will | 177 Either "spanning" or "split", to specify how this extension will |
| 158 behave if allowed to run in incognito mode. | 178 behave if allowed to run in incognito mode. |
| 159 </p> | 179 </p> |
| 160 | 180 |
| 161 <p> | 181 <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 | 199 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 | 200 <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> | 201 into a remote server or persist settings locally, use <em>spanning</em> |
| 182 incognito behavior. | 202 incognito behavior. |
| 183 </p> | 203 </p> |
| 184 | 204 |
| 185 <h3 id="key">key</h3> | 205 <h3 id="key">key</h3> |
| 186 | 206 |
| 187 <p> | 207 <p> |
| 188 This value can be used to control | 208 This value can be used to control |
| 189 the unique ID of an extension when | 209 the unique ID of an extension, app, or theme when |
| 190 it is loaded during development. | 210 it is loaded during development. |
| 191 </p> | 211 </p> |
| 192 | 212 |
| 193 <p class="note"> | 213 <p class="note"> |
| 194 <b>Note:</b> Most extensions should not need to | 214 <b>Note:</b> You don't usually need to |
| 195 use this value. Instead, write your | 215 use this value. Instead, write your |
| 196 code so that the key value doesn't matter | 216 code so that the key value doesn't matter |
| 197 by using <a href="overview.html#relative-urls">relative paths</a> | 217 by using <a href="overview.html#relative-urls">relative paths</a> |
| 198 and <a href="extension.html#method-getURL">chrome.extension.getURL()</a>. | 218 and <a href="extension.html#method-getURL">chrome.extension.getURL()</a>. |
| 199 </p> | 219 </p> |
| 200 | 220 |
| 201 <p> | 221 <p> |
| 202 To get a suitable key value, first | 222 To get a suitable key value, first |
| 203 install your extension from a <code>.crx</code> file | 223 install your extension from a <code>.crx</code> file |
| 204 (you may need to | 224 (you may need to |
| 205 <a href="hosting.html#gallery">upload your extension to the gallery</a>, | 225 <a href="https://chrome.google.com/webstore/developer/dashboard">upload your ext
ension</a> |
| 206 or <a href="packaging.html">package it manually</a>). | 226 or <a href="packaging.html">package it manually</a>). |
| 207 Then, in your | 227 Then, in your |
| 208 <a href="http://www.chromium.org/user-experience/user-data-directory">user | 228 <a href="http://www.chromium.org/user-experience/user-data-directory">user |
| 209 data directory</a>, look in the file | 229 data directory</a>, look in the file |
| 210 <code>Default/Extensions/<em><extensionId></em>/<em><versionString><
/em>/manifest.json</code>. | 230 <code>Default/Extensions/<em><extensionId></em>/<em><versionString><
/em>/manifest.json</code>. |
| 211 You will see the key value filled in there. | 231 You will see the key value filled in there. |
| 212 </p> | 232 </p> |
| 213 | 233 |
| 214 <h3 id="minimum_chrome_version">minimum_chrome_version</h3> | 234 <h3 id="minimum_chrome_version">minimum_chrome_version</h3> |
| 215 | 235 |
| 216 <p> | 236 <p> |
| 217 The version of Google Chrome that your extension requires, if any. | 237 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 | 238 The format for this string is the same as for the |
| 219 <a href="#version">version</a> field. | 239 <a href="#version">version</a> field. |
| 220 | 240 |
| 221 <h3 id="name">name</h3> | 241 <h3 id="name">name</h3> |
| 222 | 242 |
| 223 <p> | 243 <p> |
| 224 A short, plain text string | 244 A short, plain text string |
| 225 (no more than 45 characters) | 245 (no more than 45 characters) |
| 226 that identifies the extension. | 246 that identifies the extension. |
| 227 The name is used in the install dialog, | 247 The name is used in the install dialog, |
| 228 extension management UI, | 248 extension management UI, |
| 229 and the <a href="https://chrome.google.com/extensions">extension gallery</a>. | 249 and the <a href="https://chrome.google.com/webstore">store</a>. |
| 230 You can specify locale-specific strings for this field; | 250 You can specify locale-specific strings for this field; |
| 231 see <a href="i18n.html">Internationalization</a> for details. | 251 see <a href="i18n.html">Internationalization</a> for details. |
| 232 </p> | 252 </p> |
| 233 | 253 |
| 234 <h3 id="permissions">permissions</h3> | 254 <h3 id="permissions">permissions</h3> |
| 235 | 255 |
| 236 <p> | 256 <p> |
| 237 An array of permissions that the extension might use. | 257 An array of permissions that the extension or app might use. |
| 238 Each permission can be either one of a list of known strings | 258 Each permission can be either one of a list of known strings |
| 239 (such as "tabs") | 259 (such as "geolocation") |
| 240 or a match pattern | 260 or a match pattern |
| 241 that gives access to one or more hosts. | 261 that gives access to one or more hosts. |
| 242 These permissions are displayed to users before installation. | 262 Permissions can help to limit damage |
| 243 Permissions might also help to limit damage | 263 if your extension or app is attacked. |
| 244 if your extension is attacked. | 264 Some permissions are also displayed to users before installation, |
| 265 as detailed in |
| 266 <a href="permission_warnings.html">Permission Warnings</a>. |
| 245 </p> | 267 </p> |
| 246 | 268 |
| 247 <p> | 269 <p> |
| 248 If an API requires you to declare a permission in the manifest, | 270 If an extension API requires you to declare a permission in the manifest, |
| 249 then its documentation tells you how to do so. | 271 then its documentation tells you how to do so. |
| 250 For example, | 272 For example, |
| 251 the <a href="tabs.html">Tabs</a> page | 273 the <a href="tabs.html">Tabs</a> page |
| 252 shows you how to | 274 shows you how to |
| 253 declare the "tabs" permission. | 275 declare the "tabs" permission. |
| 254 </p> | 276 </p> |
| 255 | 277 |
| 256 <p> | 278 <p> |
| 257 Here's an example of the permissions part of a manifest file: | 279 Here's an example of the permissions part of a manifest file |
| 280 for an extension: |
| 258 </p> | 281 </p> |
| 259 | 282 |
| 260 <pre> | 283 <pre> |
| 261 "permissions": [ | 284 "permissions": [ |
| 262 "tabs", | 285 "tabs", |
| 263 "bookmarks", | 286 "bookmarks", |
| 264 "http://www.blogger.com/", | 287 "http://www.blogger.com/", |
| 265 "http://*.google.com/", | 288 "http://*.google.com/", |
| 266 "unlimitedStorage" | 289 "unlimitedStorage" |
| 267 ], | 290 ], |
| 268 </pre> | 291 </pre> |
| 269 | 292 |
| 270 <p> | 293 <p> |
| 271 The following table lists the permissions an extension can use. | 294 The following table lists the permissions an extension |
| 295 or packaged app can use. |
| 296 </p> |
| 297 |
| 298 <p class="note"> |
| 299 <strong>Note:</strong> |
| 300 Hosted apps can use the |
| 301 "geolocation", "notifications", and "unlimitedStorage" permissions, |
| 302 but not any other permissions listed in this table. |
| 272 </p> | 303 </p> |
| 273 | 304 |
| 274 <table> | 305 <table> |
| 275 <tr> | 306 <tr> |
| 276 <th> Permission </th> <th> Description </th> | 307 <th> Permission </th> <th> Description </th> |
| 277 </tr> | 308 </tr> |
| 278 <tr> | 309 <tr> |
| 279 <td> <em>match pattern</em> </td> | 310 <td> <em>match pattern</em> </td> |
| 280 <td> Specifies a <em>host permission</em>. | 311 <td> Specifies a <em>host permission</em>. |
| 281 Required if the extension wants to interact | 312 Required if the extension wants to interact |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 <p> | 447 <p> |
| 417 A missing integer is equal to zero. | 448 A missing integer is equal to zero. |
| 418 For example, 1.1.9.9999 is newer than 1.1. | 449 For example, 1.1.9.9999 is newer than 1.1. |
| 419 </p> | 450 </p> |
| 420 | 451 |
| 421 <p> | 452 <p> |
| 422 For more information, see | 453 For more information, see |
| 423 <a href="autoupdate.html">Autoupdating</a>. | 454 <a href="autoupdate.html">Autoupdating</a>. |
| 424 </p> | 455 </p> |
| 425 | 456 |
| 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.] --> | 457 <!-- [PENDING: Possibly: point to the store/dashboard and make a big deal of the
fact that autoupdating is free if you use them.] --> |
| OLD | NEW |