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.
{ "name": "My Extension", "version": "versionString", "description": "A plain text description", "icons": { ... }, "update_url": "http://path/to/updateInfo.xml", "background_page": "aFile.html", "content_scripts": [...], "page_actions": [...], "permissions": [...], "plugins": [...], "theme": [...], "toolstrips": [...], }
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) that describes the extension. The description should be suitable for both the browser's extension management UI and the extension gallery.
An icon that represents the extension. As a rule, you should use the icons field instead, so that you can specify icons in multiple sizes. Here's an example of using this field:
"icon": "icon.png",
One or more icons that represent the extension. We recommend that you provide icons in four sizes — 16x16, 32x32, 48x48, and 128x128 pixels. The icons can be in any format supported by WebKit, such as BMP, GIF, ICO, JPEG, or PNG. Here's an example of specifying all four icon sizes:
"icons": { "16": "icon16.png", "32": "icon32.png", "48": "icon48.png", "128": "icon128.png" },
A short, plain text string that identifies the extension. The name is used in the install dialog, extension management UI, and the extension gallery.
The capabilities the extension might use. A permission can be either one of a list of known strings (currently, either "tabs" or "bookmarks") or a match pattern, which gives access to one or more hosts. The idea is not to restrict what you can do, but to give advanced users an indication of what your extension will be able to do. Permissions might also help to limit damage if your extension is attacked.
Here's an example of the permissions part of a manifest file:
"permissions": [ "tabs", "bookmarks", "http://www.blogger.com/", "http://*.google.com/" ],
For more information, see Match patterns. Note, however, that the match pattern in the permissions field specifies only the hosts — not the paths — to which the extension can make XMLHttpRequests.