1<div id="pageData-name" class="pageData">Formats: Manifest Files</div> 2<div id="pageData-showTOC" class="pageData">true</div> 3 4<p> 5Every extension, installable web app, and theme has a 6<a href="http://www.json.org">JSON</a>-formatted manifest file, 7named <code>manifest.json</code>, 8that provides important information. 9</p> 10 11<h2 id="overview"> Field summary </h2> 12 13<p> 14The following code shows the supported manifest fields, 15with links to the page that discusses each field. 16The only fields that are always required 17are <b>name</b> and <b>version</b>. 18</p> 19 20<pre> 21{ 22 <em>// Required</em> 23 "<a href="#name">name</a>": "<em>My Extension</em>", 24 "<a href="#version">version</a>": "<em>versionString</em>", 25 26 <em>// Recommended</em> 27 "<a href="#description">description</a>": "<em>A plain text description</em>", 28 "<a href="#icons">icons</a>": { ... }, 29 "<a href="#default_locale">default_locale</a>": "<em>en</em>", 30 31 <em>// Pick one (or none)</em> 32 "<a href="browserAction.html">browser_action</a>": {...}, 33 "<a href="pageAction.html">page_action</a>": {...}, 34 "<a href="themes.html">theme</a>": {...}, 35 "<a href="#app">app</a>": {...}, 36 37 <em>// Add any of these that you need</em> 38 "<a href="background_pages.html">background_page</a>": "<em>aFile</em>.html", 39 "<a href="override.html">chrome_url_overrides</a>": {...}, 40 "<a href="content_scripts.html">content_scripts</a>": [...], 41 "<a href="#homepage_url">homepage_url</a>": "http://<em>path/to/homepage</em>", 42 "<a href="#incognito">incognito</a>": "spanning" <em>or</em> "split", 43 "<a href="#key">key</a>": "<em>publicKey</em>", 44 "<a href="#minimum_chrome_version">minimum_chrome_version</a>": "<em>versionString</em>", 45 "<a href="omnibox.html">omnibox</a>": { "keyword" : "<em>aString</em>" }, 46 "<a href="options.html">options_page</a>": "<em>aFile</em>.html", 47 "<a href="#permissions">permissions</a>": [...], 48 "<a href="npapi.html">plugins</a>": [...], 49 "<a href="autoupdate.html">update_url</a>": "http://<em>path/to/updateInfo</em>.xml" 50} 51</pre> 52 53 54<h2>Field details</h2> 55 56<p> 57This section covers fields that aren't described in another page. 58For a complete list of fields, 59with links to where they're described in detail, 60see the <a href="#overview">Field summary</a>. 61</p> 62 63 64<h3 id="app">app</h3> 65 66<p> 67Used by installable web apps, 68including packaged apps, 69to specify the URLs that the app uses. 70Most important is the <em>launch page</em> for the app—the 71page that the browser goes to when the user clicks the app's icon 72in the New Tab page. 73</p> 74 75<p> 76For details, see the documentation for 77<a href="http://code.google.com/chrome/apps/docs/developers_guide.html">hosted apps</a> and 78<a href="apps.html">packaged apps</a>. 79</p> 80 81<h3 id="default_locale">default_locale</h3> 82 83<p> 84Specifies the subdirectory of <code>_locales</code> 85that contains the default strings for this extension. 86This field is <b>required</b> in extensions 87that have a <code>_locales</code> directory; 88it <b>must be absent</b> in extensions 89that have no <code>_locales</code> directory. 90For details, see 91<a href="i18n.html">Internationalization</a>. 92</p> 93 94<h3 id="description">description</h3> 95 96<p> 97A plain text string 98(no HTML or other formatting; 99no more than 132 characters) 100that describes the extension. 101The description should be suitable for both 102the browser's extension management UI 103and the <a href="https://chrome.google.com/webstore">Chrome Web Store</a>. 104You can specify locale-specific strings for this field; 105see <a href="i18n.html">Internationalization</a> for details. 106</p> 107 108<h3 id="homepage_url">homepage_url</h3> 109 110<p> 111The URL of the homepage for this extension. The extensions management page (chrome://extensions) 112will contain a link to this URL. This field is particularly useful if you 113<a href="hosting.html">host the extension on your own site</a>. If you distribute your 114extension using the <a href="https://chrome.google.com/extensions">Extensions Gallery</a> or <a href="https://chrome.google.com/webstore">Chrome Web Store</a>, 115the homepage URL defaults to the extension's own page. 116</p> 117 118<h3 id="icons">icons</h3> 119 120<p> 121One or more icons that represent the extension, app, or theme. 122You should always provide a 128x128 icon; 123it's used during installation and by the Chrome Web Store. 124Extensions should also provide a 48x48 icon, 125which is used in the extensions management page 126(chrome://extensions). 127You can also specify a 16x16 icon to be used as the favicon 128for an extension's pages. 129The 16x16 icon is also displayed in the experimental extension 130<a href="experimental.infobars.html">infobar</a> 131feature. 132</p> 133 134<p> 135Icons should generally be in PNG format, 136because PNG has the best support for transparency. 137They can, however, be in any format supported by WebKit, 138including BMP, GIF, ICO, and JPEG. 139Here's an example of specifying the icons: 140</p> 141 142<pre> 143"icons": { "16": "icon16.png", 144 "48": "icon48.png", 145 "128": "icon128.png" }, 146</pre> 147 148<p class="note"> 149<b>Important:</b> 150Use only the documented icon sizes. 151<br><br> 152You might notice that Chrome sometimes resizes these icons down to smaller 153sizes. For example, the install dialog might shrink the 128-pixel 154icon down to 69 pixels. 155<br><br> 156However, the details of 157Chrome's UI may change between versions, and these changes assume that 158developers are using the documented sizes. If you use other sizes, 159your icon may look bad in future versions of the browser. 160</p> 161 162<p> 163If you upload your extension, app, or theme using the 164<a href="https://chrome.google.com/webstore/developer/dashboard">Chrome Developer Dashboard</a>, 165you'll need to upload additional images, 166including at least one screenshot of your extension. 167For more information, 168see the 169<a href="http://code.google.com/chrome/webstore/">Chrome Web Store 170developer documentation</a>. 171</p> 172 173<h3 id="incognito">incognito</h3> 174 175<p> 176Either "spanning" or "split", to specify how this extension will 177behave if allowed to run in incognito mode. 178</p> 179 180<p> 181The default for extensions is "spanning", which means that the extension 182will run in a single shared process. Any events or messages from an incognito 183tab will be sent to the shared process, with an <em>incognito</em> flag 184indicating where it came from. 185</p> 186 187<p> 188The default for installable web apps is "split", 189which means that all app pages in 190an incognito window will run in their own incognito process. If the app or extension contains a background page, that will also run in the incognito process. 191This incognito process runs along side the regular process, but has a separate 192memory-only cookie store. Each process sees events and messages only from its 193own context (for example, the incognito process will see only incognito tab updates). 194The processes are unable to communicate with each other. 195</p> 196 197<p> 198As a rule of thumb, if your extension or app needs to load a tab in an incognito browser, use 199<em>split</em> incognito behavior. If your extension or app needs to be logged 200into a remote server or persist settings locally, use <em>spanning</em> 201incognito behavior. 202</p> 203 204<h3 id="key">key</h3> 205 206<p> 207This value can be used to control 208the unique ID of an extension, app, or theme when 209it is loaded during development. 210</p> 211 212<p class="note"> 213<b>Note:</b> You don't usually need to 214use this value. Instead, write your 215code so that the key value doesn't matter 216by using <a href="overview.html#relative-urls">relative paths</a> 217and <a href="extension.html#method-getURL">chrome.extension.getURL()</a>. 218</p> 219 220<p> 221To get a suitable key value, first 222install your extension from a <code>.crx</code> file 223(you may need to 224<a href="https://chrome.google.com/webstore/developer/dashboard">upload your extension</a> 225or <a href="packaging.html">package it manually</a>). 226Then, in your 227<a href="http://www.chromium.org/user-experience/user-data-directory">user 228data directory</a>, look in the file 229<code>Default/Extensions/<em><extensionId></em>/<em><versionString></em>/manifest.json</code>. 230You will see the key value filled in there. 231</p> 232 233<h3 id="minimum_chrome_version">minimum_chrome_version</h3> 234 235<p> 236The version of Chrome that your extension, app, or theme requires, if any. 237The format for this string is the same as for the 238<a href="#version">version</a> field. 239 240<h3 id="name">name</h3> 241 242<p> 243A short, plain text string 244(no more than 45 characters) 245that identifies the extension. 246The name is used in the install dialog, 247extension management UI, 248and the <a href="https://chrome.google.com/webstore">store</a>. 249You can specify locale-specific strings for this field; 250see <a href="i18n.html">Internationalization</a> for details. 251</p> 252 253<h3 id="permissions">permissions</h3> 254 255<p> 256An array of permissions that the extension or app might use. 257Each permission can be either one of a list of known strings 258(such as "geolocation") 259or a match pattern 260that gives access to one or more hosts. 261Permissions can help to limit damage 262if your extension or app is attacked. 263Some permissions are also displayed to users before installation, 264as detailed in 265<a href="permission_warnings.html">Permission Warnings</a>. 266</p> 267 268<p> 269If an extension API requires you to declare a permission in the manifest, 270then its documentation tells you how to do so. 271For example, 272the <a href="tabs.html">Tabs</a> page 273shows you how to 274declare the "tabs" permission. 275</p> 276 277<p> 278Here's an example of the permissions part of a manifest file 279for an extension: 280</p> 281 282<pre> 283"permissions": [ 284 "tabs", 285 "bookmarks", 286 "http://www.blogger.com/", 287 "http://*.google.com/", 288 "unlimitedStorage" 289], 290</pre> 291 292<p> 293The following table lists the permissions an extension 294or packaged app can use. 295</p> 296 297<p class="note"> 298<strong>Note:</strong> 299Hosted apps can use the 300"background", "geolocation", "notifications", and "unlimitedStorage" permissions, 301but not any other permissions listed in this table. 302</p> 303 304<table> 305<tr> 306 <th> Permission </th> <th> Description </th> 307</tr> 308<tr> 309 <td> <em>match pattern</em> </td> 310 <td> Specifies a <em>host permission</em>. 311 Required if the extension wants to interact 312 with the code running on pages. 313 Many extension capabilities, such as 314 <a href="xhr.html">cross-origin XMLHttpRequests</a>, 315 <a href="content_scripts.html#pi">programmatically injected 316 content scripts</a>, and <a href="cookies.html">the cookies API</a> 317 require host permissions. For details on the syntax, see 318 <a href="match_patterns.html">Match Patterns</a>. 319 </td> 320</tr> 321<tr id="bg"> 322 <td> "background" </td> 323 <td> <p> 324 Makes Chrome start up early and and shut down late, 325 so that apps and extensions can have a longer life. 326 </p> 327 328 <p> 329 When any installed hosted app, packaged app, or extension 330 has "background" permission, Chrome runs (invisibly) 331 as soon as the user logs into their computer—before 332 the user launches Chrome. 333 The "background" permission also makes Chrome continue running 334 (even after its last window is closed) 335 until the user explicitly quits Chrome. 336 </p> 337 338 <p class="note"> 339 <b>Note:</b> 340 Disabled apps and extensions 341 are treated as if they aren't installed. 342 </p> 343 344 <p> 345 You typically use the "background" permission with a 346 <a href="background_pages.html">background page</a> 347 or (for hosted apps) a 348 <a href="http://code.google.com/chrome/apps/docs/background.html">background window</a>. 349 </p> 350 </td> 351</tr> 352<tr> 353 <td> "bookmarks" </td> 354 <td> Required if the extension uses the 355 <a href="bookmarks.html">chrome.bookmarks</a> module. </td> 356</tr> 357<tr> 358 <td> "chrome://favicon/" </td> 359 <td> Required if the extension uses the 360 "chrome://favicon/<em>url</em>" mechanism 361 to display the favicon of a page. 362 For example, to display the favicon of http://www.google.com/, 363 you declare the "chrome://favicon/" permission 364 and use HTML code like this: 365 <pre><img src="chrome://favicon/http://www.google.com/"></pre> 366 </td> 367</tr> 368<tr> 369 <td> "contextMenus" </td> 370 <td> Required if the extension uses the 371 <a href="contextMenus.html">chrome.contextMenus</a> module. </td> 372</tr> 373<tr> 374 <td> "cookies" </td> 375 <td> Required if the extension uses the 376 <a href="cookies.html">chrome.cookies</a> module. </td> 377</tr> 378<tr> 379 <td> "experimental" </td> 380 <td> Required if the extension uses any 381 <a href="http://code.google.com/chrome/extensions/dev/experimental.html">chrome.experimental.* APIs</a>.</td> 382</tr> 383<tr> 384 <td id="geolocation"> "geolocation" </td> 385 <td> Allows the extension to use the proposed HTML5 386 <a href="http://dev.w3.org/geo/api/spec-source.html">geolocation API</a> 387 without prompting the user for permission. </td> 388</tr> 389<tr> 390 <td> "history" </td> 391 <td> Required if the extension uses the 392 <a href="history.html">chrome.history</a> module. </td> 393</tr> 394<tr> 395 <td> "idle" </td> 396 <td> Required if the extension uses the 397 <a href="idle.html">chrome.idle</a> module. </td> 398</tr> 399<tr> 400 <td> "management" </td> 401 <td> Required if the extension uses the 402 <a href="management.html">chrome.management</a> module. </td> 403</tr> 404<tr> 405 <td> "notifications" </td> 406 <td> Allows the extension to use the proposed HTML5 407 <a href="http://www.chromium.org/developers/design-documents/desktop-notifications/api-specification">notification API</a> 408 without calling permission methods 409 (such as <code>checkPermission()</code>). 410 For more information see 411 <a href="notifications.html">Desktop Notifications</a>.</td> 412</tr> 413<tr> 414 <td> "tabs" </td> 415 <td> Required if the extension uses the 416 <a href="tabs.html">chrome.tabs</a> or 417 <a href="windows.html">chrome.windows</a> module. </td> 418</tr> 419<tr> 420 <td> "unlimitedStorage"</td> 421 <td> Provides an unlimited quota for storing HTML5 client-side data, 422 such as databases and local storage files. 423 Without this permission, the extension is limited to 424 5 MB of local storage. 425 426 <p class="note"> 427 <b>Note:</b> 428 This permission applies only to Web SQL Database and application cache 429 (see issue <a href="http://crbug.com/58985">58985</a>). 430 Also, it doesn't currently work with wildcard subdomains such as 431 <code>http://*.example.com</code>. 432 </p> 433 </td> 434</tr> 435</table> 436 437 438<h3 id="version">version</h3> 439 440<p> 441One to four dot-separated integers 442identifying the version of this extension. 443A couple of rules apply to the integers: 444they must be between 0 and 65535, inclusive, 445and non-zero integers can't start with 0. 446For example, 99999 and 032 are both invalid. 447</p> 448 449<p> 450Here are some examples of valid versions: 451</p> 452 453<ul> 454 <li> <code>"version": "1"</code> </li> 455 <li> <code>"version": "1.0"</code> </li> 456 <li> <code>"version": "2.10.2"</code> </li> 457 <li> <code>"version": "3.1.2.4567"</code> </li> 458</ul> 459 460<p> 461The autoupdate system compares versions 462to determine whether an installed extension 463needs to be updated. 464If the published extension has a newer version string 465than the installed extension, 466then the extension is automatically updated. 467</p> 468 469<p> 470The comparison starts with the leftmost integers. 471If those integers are equal, 472the integers to the right are compared, 473and so on. 474For example, 1.2.0 is a newer version than 1.1.9.9999. 475</p> 476 477<p> 478A missing integer is equal to zero. 479For example, 1.1.9.9999 is newer than 1.1. 480</p> 481 482<p> 483For more information, see 484<a href="autoupdate.html">Autoupdating</a>. 485</p> 486 487<!-- [PENDING: Possibly: point to the store/dashboard and make a big deal of the fact that autoupdating is free if you use them.] --> 488