Manifest file format  |  Chrome for Developers (2024)

  • Home
  • Docs
  • Chrome Extensions
  • Reference
  • Manifest
Stay organized with collections Save and categorize content based on your preferences.

Every extension must have a manifest.json file in its root directory thatlists important information about the structure and behavior of that extension.This page explains the structure of extension manifests and the features theycan include.

Examples

The following example manifests show the basic manifest structure and somecommonly used features as a starting point for creating your own manifest:

Minimal manifest

{ "manifest_version": 3, "name": "Minimal Manifest", "version": "1.0.0", "description": "A basic example extension with only required keys", "icons": { "48": "images/icon-48.png", "128": "images/icon-128.png" },}

Register a content script

{ "manifest_version": 3, "name": "Run script automatically", "description": "Runs a script on www.example.com automatically when user installs the extension", "version": "1.0", "icons": { "16": "images/icon-16.png", "32": "images/icon-32.png", "48": "images/icon-48.png", "128": "images/icon-128.png" }, "content_scripts": [ { "js": [ "content-script.js" ], "matches": [ "http://*.example.com//" ] } ]}

Inject a content script

{ "manifest_version": 3, "name": "Click to run", "description": "Runs a script when the user clicks the action toolbar icon.", "version": "1.0", "icons": { "16": "images/icon-16.png", "32": "images/icon-32.png", "48": "images/icon-48.png", "128": "images/icon-128.png" }, "background": { "service_worker": "service-worker.js" }, "action": { "default_icon": { "16": "images/icon-16.png", "32": "images/icon-32.png", "48": "images/icon-48.png", "128": "images/icon-128.png" } }, "permissions": ["scripting", "activeTab"]}

Popup with permissions

{ "manifest_version": 3, "name": "Popup extension that requests permissions", "description": "Extension that includes a popup and requests host permissions and storage permissions .", "version": "1.0", "icons": { "16": "images/icon-16.png", "32": "images/icon-32.png", "48": "images/icon-48.png", "128": "images/icon-128.png" }, "action": { "default_popup": "popup.html" }, "host_permissions": [ "https://*.example.com/" ], "permissions": [ "storage" ]}

Side panel

{ "manifest_version": 3, "name": "Side panel extension", "version": "1.0", "description": "Extension with a default side panel.", "icons": { "16": "images/icon-16.png", "48": "images/icon-48.png", "128": "images/icon-128.png" }, "side_panel": { "default_path": "sidepanel.html" }, "permissions": ["sidePanel"]}

Manifest keys

The following is a list of all supported manifest keys.

Keys required by the Extensions platform

"manifest_version"
An integer specifying the version of the manifest file format that yourextension uses. The only supported value is 3.
"name"
A string that identifies the extension in the Chrome WebStore, the install dialog, andthe user's Chrome Extensions page (chrome://extensions). Themaximum length is 75 characters. For information on using locale-specific names,see Internationalization.
"version"
A string that identifies the extension's version number. For information onversion number formatting, see Version.

Keys required by Chrome Web Store

"description"
A string that describes the extension on both the Chrome Web Store and the user'sextension management page. The maximum length is 132 characters. For informationon localizing descriptions, see Internationalization.
"icons"
One or more icons that represent your extension. For information about bestpractices, see Icons.

Optional keys

"action"
Defines the appearance and behavior of the extension's icon in the GoogleToolbar. For more information, see chrome.action.
"author"
Specifies the email address of the account that was used to create theextension.
"background"
Specifies the JavaScript file containing the extension's service worker, which acts asan event handler. For more information, see About extension serviceworkers.
"chrome_settings_overrides"
Defines overrides for selected Chrome settings. For more information, seeOverriding Chrome settings.
"chrome_url_overrides"
Defines overrides for default Chrome pages. For more information, seeOverride Chrome pages.
"commands"
Defines keyboard shortcuts within the extension. For moreinformation, see chrome.commands.
"content_scripts"
Specifies JavaScript or CSS files to be used when the user opens certain webpages. For more information, see Content scripts.
"content_security_policy"
Defines restrictions on the scripts, styles, and other resources an extensioncan use. For more information, see Content security policy.
"cross_origin_embedder_policy"
Specifies a value for the Cross-Origin-Embedder-Policy HTTP header, whichconfigures embedding of cross-origin resources in an extension page.
"cross_origin_opener_policy"
Specifies a value for the Cross-Origin-Opener-Policy HTTP header, which letsyou ensure that a top-level extension page doesn't share a browsing contextgroup with cross-origin documents.
"declarative_net_request"
Defines static rules for the declarativeNetRequestAPI, which allows blocking and modifying of network requests.
"default_locale"
A string that defines the default language of an extension that supportsmultiple locales. Examples include "en" and "pt_BR". This key is required inlocalized extensions, and must not be used in extensions that aren't localized.For more information, see Internationalization.
"devtools_page"
Defines pages that use the DevTools APIs.
"export"
Allows resources to be exported from the extension. For more information, seeExport.
"externally_connectable"
Specifies what other pages and extensions can connect to your extensions. Formore information, see "externally_connectable".
"homepage_url"
A string specifying a URL for the extension's homepage. If this is undefined,the homepage defaults to the extension's Chrome Web Store page. This field isparticularly useful if you host the extensionon your own site.
"host_permissions"
Lists the web pages your extension is allowed to interact with, defined usingURL match patterns. User permission for these sites is requested at installtime. For more information, see Host permissions.
"import"
Allows resources to be imported into the extension. For more information, seeImport.
"incognito"
Defines how the extension behaves in incognito mode. Supported values are"spanning", "split", and "not_allowed". For more information, seeIncognito.
"key"
Specifies your extension's ID for various development use cases. For moreinformation, see Key.
"minimum_chrome_version"
Defines the oldest Chrome version that can install your extension. The valuemust be a substring of an existing Chrome browser version string, such as"107" or "107.0.5304.87". Users with versions of Chrome older than theminimum version see a "Not compatible" warning in the Chrome Web Store, and areunable to install your extension. If you add this to an existing extension,users whose Chrome version is older won't receive automatic updates to yourextension. This includes business users inephemeral mode.
"oauth2"
Allows the use of an OAuth 2.0 security ID. The value of this key must be anobject with "client_id" and "scopes" properties. For details, see the OAuth2.0 tutorial.
"omnibox"
Allows the extension to register a keyword in Chrome's address bar. For moreinformation, see Omnibox.
"optional_host_permissions"
Declares optional hostpermissions foryour extension.
"optional_permissions"
Declares optional permissions for your extension.
"options_page"
Specifies a path to an options.html file for the extension to use as anoptions page. For more information, see Give usersoptions.
"options_ui"
Specifies a path to an HTML file that lets a user change extension optionsfrom the Chrome Extensions page. For more information, see Embeddedoptions.
"permissions"
Enables use of particular extension APIs. See Permissionsfor a general explanation. Reference pages for individual APIs list thepermissions they require.
"requirements"
Lists technologies required to use the extension. For a list of supportedrequirements, see Requirements.
"sandbox"
Defines a set of extension pages that don't have access to extension APIs ordirect access to non-sandboxed pages. For more information, seeSandbox.
"short_name"
A string containing a shortened version of the extension's name to be usedwhen character space is limited. The maximum length is 12 characters. If this isundefined, a truncated version of the "name" key displays instead.
"side_panel"
Identifies an HTML file to display in asidePanel.
"storage"
Declares a JSON schema for the managed storagearea. For moreinformation, see Manifest for storage areas.
"tts_engine"
Registers the extension as a text to speech engine. For more information, seethe ttsEngine API.
"update_url"
A string containing the URL of the extension's updates page. Use this key ifyou're hosting your extensionoutside the Chrome Web Store.
"version_name"
A string describing the extension's version. Examples include "1.0 beta" and"build rc2". If this is unspecified, the "version" value displays on theextension management page instead.
"web_accessible_resources"
Defines files within the extension that can be accessed by web pages or otherextensions. For more information, see Web AccessibleResources.

Optional ChromeOS keys

"file_browser_handlers"
Provides access to the fileBrowserHandlerAPI, which lets extensions access the ChromeOS file browser.
"file_handlers"
Specifies file types for ChromeOS extensions to handle. For more information,see file_handlers.
"file_system_provider_capabilities"
Allows access to the fileSystemProviderAPI, which lets extensions create file systems that ChromeOS can use.
"input_components"
Allows the use of the Input Method Editor API. For more information, seeinput_components.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2012-09-18 UTC.

Manifest file format  |  Chrome for Developers (2024)
Top Articles
Latest Posts
Article information

Author: Rueben Jacobs

Last Updated:

Views: 5724

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Rueben Jacobs

Birthday: 1999-03-14

Address: 951 Caterina Walk, Schambergerside, CA 67667-0896

Phone: +6881806848632

Job: Internal Education Planner

Hobby: Candle making, Cabaret, Poi, Gambling, Rock climbing, Wood carving, Computer programming

Introduction: My name is Rueben Jacobs, I am a cooperative, beautiful, kind, comfortable, glamorous, open, magnificent person who loves writing and wants to share my knowledge and understanding with you.