最終更新:2025-01-18 (土) 03:08:39 (22d)
manifest.json
Top / manifest.json
拡張機能の名前や動き、使用するファイルなどを定義するためのファイル
http://code.google.com/chrome/extensions/manifest.html
バージョン
バージョン1
- Manifest version 1 was deprecated in Chrome 18
{ // 必須 "name": "サンプル",/*(45文字以下*/ "version": "1.0.0", // 書いた方が良い "description": "これはサンプルの拡張機能です。",/*132文字以下*/ "icons": {/*PNG形式推奨、他にBMP、GIF、JPEG、ICOファイルに対応*/ "48": "48x48.png", "128": "128x128.png" },
バージョン2
- 最低限は下記
{ "name": "拡張機能の名前", "version": "拡張機能のバージョン", "manifest_version": 2, },
変更点
- content_security_policyの追加
script-src 'self'; object-src 'self'
- web_accessible_resourcesの追加
- A package's resources are no longer available by default to external websites (as the src of an image, or a script tag)
- background_pageがbackgroundに変更
- ブラウザアクションの変更
- The browser_actions key in the manifest, and the chrome.browserActions API are gone.
- Use the singular browser_action? and chrome.browserAction instead.
- The icons property of browser_action has been removed.
- The name property of browser_action has been removed.
- The popup property of browser_action has been removed.
- The default_popup property of browser_action can no longer be specified as an object. It must be a string.
- The browser_actions key in the manifest, and the chrome.browserActions API are gone.
- ページアクションの変更
- The page_actions key in the manifest, and the chrome.pageActions API are gone.
- The icons property of page_action has been removed.
- The name property of page_action has been removed.
- The popup property of page_action has been removed.
- Use the default_popup property or chrome.pageAction.setPopup? instead.
- The default_popup property of page_action can no longer be specified as an object. It must be a string.
- The chrome.self API has been removed.
- Use chrome.extension instead.
- chrome.extension.getTabContentses? (!!!) and chrome.extension.getExtensionTabs? are gone.
- Use chrome.extension.getViews({ "type": "tab" }) instead.
- Port.tab is gone. Use Port.sender instead.
メモ
- HTML 内へ直接 JavaScript の記述が不可に
Google Chrome/拡張機能/Manifest V3
項目
https://developer.chrome.com/extensions/manifest.html
- manifest_version?
- name?
- version?
- default_locale?
- description?
- icons?
- browser_action?
- browser_actions? (deprecated, browser_action?に変更)
- page_action?
- author?
- background
- background_page (deprecated. backgroundに変更。)
- chrome_settings_overrides?
- chrome_url_overrides?
- commands?
- content_pack?
- content_scripts
- content_security_policy?
- converted_from_user_script
- current_locale?
- devtools_page?
- externally_connectable?
- file_browser_handlers?
- homepage_url?
- import
- incognito?
- input_components?
- key?
- minimum_chrome_version?
- nacl_modules?
- oauth2?
- offline_enabled?
- omnibox?
- optional_permissions?
- options_page?
- page_actions? (deprecated, page_action?に変更)
- permissions
- platforms?
- plugins?
- requirements?
- sandbox?
- script_badge?
- short_name?
- signature?
- spellcheck?
- storage?
- system_indicator?
- tts_engine?
- update_url?
- web_accessible_resources
サンプル
{ // 必須 "name": "サンプル",/*(45文字以下*/ "version": "1.0.0", // 書いた方が良い "description": "これはサンプルの拡張機能です。",/*132文字以下*/ "icons": {/*PNG形式推奨、他にBMP、GIF、JPEG、ICOファイルに対応*/ "48": "48x48.png", "128": "128x128.png" }, // 用途に応じて一つ選択 "browser_action": { "default_icon": "tooltip.png", "default_title": "Tooltip Message", "popup": "popup.html" }, "page_action": { "default_icon": "tooltip.png", "default_title": "Tooltip Message", "popup": "popup.html" }, "content_scripts": [ { "js": [ "x.js", "bookmark.js" ], "css": [ "bookmark.css" ], "matches": [ "http://*/*" ] } ], "theme": {...}, // 必要ならば書く "background_page": "bgpage.html", "chrome_url_overrides": { "newtab": "newpage.html" }, "content_scripts": [...], "options_page": "optpage.html",/*拡張機能ページのオプションを押したときのページ*/ "permissions": [...], "plugins": [...], "update_url": "http://path/to/updateInfo.xml" }