Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the BSD License.
©2010 Google
Every extension has a
JSON-formatted manifest file,
named manifest.json
,
that provides important information about the extension.
The following code shows the supported manifest fields, with links to the page that discusses each field. The only fields that are required for every extension are name and version.
{ // Required "name": "My Extension", "version": "versionString", // Recommended "description": "A plain text description", "icons": { ... }, "default_locale": "en", // Pick one (or none) "browser_action": {...}, "page_action": {...}, "theme": {...}, // Add any of these that you need "background_page": "aFile.html", "chrome_url_overrides": {...}, "content_scripts": [...], "minimum_chrome_version": "versionString", "options_page": "aFile.html", "permissions": [...], "plugins": [...], "update_url": "http://path/to/updateInfo.xml" }
This section covers fields that aren't described in another page. For a complete list of fields, with links to where they're described in detail, see the Field summary.
A plain text string (no HTML or other formatting; no more than 132 characters) that describes the extension. The description should be suitable for both the browser's extension management UI and the extension gallery. You can specify locale-specific strings for this field; see Internationalization for details.
One or more icons that represent the extension. You should provide icons in at least two sizes — 48x48 and 128x128 pixels. The 48x48 icon is used in the extensions management page (chrome://extensions). The 128x128 icon is used when the user installs the extension. You can also specify a 16x16 icon to be used as the favicon for the extension's pages. The 16x16 icon is also displayed in the experimental infobar feature.
Icons should generally be in PNG format, because PNG has the best support for transparency. They can, however, be in any format supported by WebKit, including BMP, GIF, ICO, and JPEG. Here's an example of specifying the icons:
"icons": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" },
Note:
Use only the documented icon sizes.
You may notice that Google Chrome sometimes resizes these icons down to smaller
sizes. For example, as of this writing, the install dialog shrinks the 128-pixel
icon down to 69 pixels.
Nevertheless, you should use only the documented sizes. The details of Google
Chrome's UI may change between versions. These changes are made assuming that
extension developers are using the documented sizes. If you use other sizes,
your icon may look bad in future versions of the browser.
If you submit your extension to the gallery, you'll need to upload additional images, including a 32x32-pixel logo and at least one screenshot of your extension. For more information on gallery requirements, see the gallery help.
Specifies the subdirectory of _locales
that contains the default strings for this extension.
This field is required in extensions
that have a _locales
directory;
it must be absent in extensions
that have no _locales
directory.
For details, see
Internationalization.
The version of Google Chrome that your extension requires, if any. The format for this string is the same as for the version field.
A short, plain text string (no more than 45 characters) that identifies the extension. The name is used in the install dialog, extension management UI, and the extension gallery. You can specify locale-specific strings for this field; see Internationalization for details.
An array of permissions that the extension might use. Each permission can be either one of a list of known strings (such as "tabs") or a match pattern that gives access to one or more hosts. These permissions are displayed to users before installation. Permissions might also help to limit damage if your extension is attacked.
If an API requires you to declare a permission in the manifest, then its documentation tells you how to do so. For example, the Tabs page shows you how to declare the "tabs" permission.
Here's an example of the permissions part of a manifest file:
"permissions": [ "tabs", "bookmarks", "http://www.blogger.com/", "http://*.google.com/", "unlimited_storage" ],
The following table lists the permissions an extension can use.
Permission | Description |
---|---|
match pattern | Required if the extension makes cross-origin XMLHttpRequests or programmatically injects JavaScript or CSS into web pages. |
"bookmarks" | Required if the extension uses the chrome.bookmarks module. |
"experimental" | Required if the extension uses any chrome.experimental.* APIs. |
"history" | Required if the extension uses the chrome.history module. |
"geolocation" | Allows the extension to use the proposed HTML5 geolocation API without prompting the user for permission. |
"notifications" | Allows the extension to use the proposed HTML5
notification API
without calling permission methods
(such as checkPermission() ).
For more information see
Desktop Notifications. |
"tabs" | Required if the extension uses the chrome.tabs or chrome.windows module. |
"unlimited_storage" | Provides an unlimited quota for storing HTML5 client-side data, such as databases and local storage files. Without this permission, the extension is limited to 5 MB of local storage. |
One to four dot-separated integers identifying the version of this extension. A couple of rules apply to the integers: they must be between 0 and 65535, inclusive, and non-zero integers can't start with 0. For example, 99999 and 032 are both invalid.
Here are some examples of valid versions:
"version": "1"
"version": "1.0"
"version": "2.10.2"
"version": "3.1.2.4567"
The autoupdate system compares versions to determine whether an installed extension needs to be updated. If the published extension has a newer version string than the installed extension, then the extension is automatically updated.
The comparison starts with the leftmost integers. If those integers are equal, the integers to the right are compared, and so on. For example, 1.2.0 is a newer version than 1.1.9.9999.
A missing integer is equal to zero. For example, 1.1.9.9999 is newer than 1.1.
For more information, see Autoupdating.