新しいコードの場合は、V2 ではなくマニフェスト V3 を使用します。 マニフェスト V3 については、「 拡張機能のマニフェスト ファイル形式」を参照してください。
マニフェスト V2 拡張機能を Manifest V3 に移行するには、「 マニフェスト V2 から V3 への拡張機能の移行」を参照してください。
拡張機能のmanifest.jsonの形式
次のコードは、マニフェスト V2 パッケージの拡張機能の manifest.json でサポートされているフィールドを示しています。
各フィールドの参照情報については、「 マニフェスト ファイル形式 (V2)」を参照し、フィールドのリンクをクリックします。
{
// 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": [...]
}
関連項目
- マニフェスト V2 から V3 に拡張機能を移行する
- マニフェスト ファイル形式 (V3) - Chrome 拡張機能>Reference。
- Chrome 拡張機能>Reference のマニフェスト ファイル形式 (V2)。
注:
このページの一部は、 Google によって 作成および共有され、 クリエイティブ・コモンズ属性 4.0 国際ライセンスに記載されている条件に従って使用される作業に基づく変更です。 元のページはこちらにあります。