Manifest file format for extensions
Every extension for Microsoft Edge has a JSON-formatted manifest file, named manifest.json
. The manifest file is the blueprint of your extension. The manifest file includes information such as:
- The version number of the extension.
- The title of the extension.
- The permissions that are needed for the extension to run.
The format for manifest.json
for extensions is moving from Manifest V2 to Manifest V3. Both formats are shown here. To migrate a Manifest V2 extension to Manifest V3, see Migrate an extension from Manifest V2 to V3.
Format of manifest.json for extensions using Manifest V3
The following code shows the fields that are supported in manifest.json
for extensions, for a Manifest V3 package.
For reference information about each field, see Manifest file format (V3) and then select the links on the fields.
{
// Required
"manifest_version": 3,
"name": "My V3 Extension",
"version": "versionString",
// Recommended
"action": {...},
"default_locale": "en",
"description": "A plain-text description",
"icons": {...},
// Optional
"action": ...,
"author": ...,
"automation": ...,
"background": {
// If `background` is included, `service_ worker` is required
"service_worker": ...
},
"chrome_settings_overrides": {...},
"chrome_url_overrides": {...},
"commands": {...},
"content_capabilities": ...,
"content_scripts": [{...}],
"content_security_policy": "policyString",
"converted_from_user_script": ...,
"current_locale": ...,
"declarative_net_request": ...,
"devtools_page": "devtools.html",
"differential_fingerprint": ...,
"event_rules": [{...}],
"externally_connectable": {
"matches": ["*://*.contoso.com/*"]
},
"file_browser_handlers": [...],
"file_system_provider_capabilities": {
"configurable": true,
"multiple_mounts": true,
"source": "network"
},
"homepage_url": "http://path/to/homepage",
"host_permissions": [...],
"import": [{"id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}],
"incognito": "spanning, split, or not_allowed",
"input_components": ...,
"key": "publicKey",
"minimum_chrome_version": "versionString",
"nacl_modules": [...],
"natively_connectable": ...,
"oauth2": ...,
"offline_enabled": true,
"omnibox": {
"keyword": "aString"
},
"optional_permissions": ["tabs"],
"options_page": "options.html",
"options_ui": {
"chrome_style": true,
"page": "options.html"
},
"permissions": ["tabs"],
"platforms": ...,
"replacement_web_app": ...,
"requirements": {...},
"sandbox": [...],
"short_name": "Short Name",
"storage": {
"managed_schema": "schema.json"
},
"system_indicator": ...,
"tts_engine": {...},
"update_url": "http://path/to/updateInfo.xml",
"version_name": "aString",
"web_accessible_resources": [...]
}
Format of manifest.json for extensions using Manifest V2
The following code shows the fields that are supported in manifest.json
for extensions, for a Manifest V2 package.
For reference information about each field, see Manifest file format (V2) and then select the links on the fields.
{
// Required
"manifest_version": 2,
"name": "My V2 Extension",
"version": "versionString",
// Recommended
"default_locale": "en",
"description": "A plain-text description",
"icons": {...},
// Pick one or none
"browser_action": {...},
"page_action": {...},
// Optional
"action": ...,
"author": ...,
"automation": ...,
"background": {
// If `background` is included, `persistent` is recommended
"persistent": false,
// If `background` is included, `service_worker` is optional
"service_worker": ...
},
"chrome_settings_overrides": {...},
"chrome_url_overrides": {...},
"commands": {...},
"content_capabilities": ...,
"content_scripts": [{...}],
"content_security_policy": "policyString",
"converted_from_user_script": ...,
"current_locale": ...,
"declarative_net_request": ...,
"devtools_page": "devtools.html",
"differential_fingerprint": ...,
"event_rules": [{...}],
"externally_connectable": {
"matches": ["*://*.contoso.com/*"]
},
"file_browser_handlers": [...],
"file_system_provider_capabilities": {
"configurable": true,
"multiple_mounts": true,
"source": "network"
},
"homepage_url": "http://path/to/homepage",
"host_permissions": ...,
"import": [{"id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}],
"incognito": "spanning, split, or not_allowed",
"input_components": ...,
"key": "publicKey",
"minimum_chrome_version": "versionString",
"nacl_modules": [...],
"natively_connectable": ...,
"oauth2": ...,
"offline_enabled": true,
"omnibox": {
"keyword": "aString"
},
"optional_permissions": ["tabs"],
"options_page": "options.html",
"options_ui": {
"chrome_style": true,
"page": "options.html"
},
"permissions": ["tabs"],
"platforms": ...,
"replacement_web_app": ...,
"requirements": {...},
"sandbox": [...],
"short_name": "Short Name",
"storage": {
"managed_schema": "schema.json"
},
"system_indicator": ...,
"tts_engine": {...},
"update_url": "http://path/to/updateInfo.xml",
"version_name": ...,
"web_accessible_resources": [...]
}
Note
Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons Attribution 4.0 International License. The original page is found here.
Untuk lebih lengkap silahkan hubungi link berikut di bawah ini:
Manifest file format for extensions - Microsoft Edge Development | Microsoft Docs
Tidak ada komentar:
Posting Komentar