1.3 Manifest V3
Manifest Version 3
リンク
Manifest V3とは
Manifest V3(MV3)は、Chrome拡張機能の最新マニフェスト形式。セキュリティ、プライバシー、パフォーマンスの向上を目的に設計された。
Manifest V2の廃止
V2は2024年から段階的に廃止。新規開発ではV3を使用すること。
基本構造
{
"manifest_version": 3,
"name": "My Extension",
"version": "1.0.0",
"description": "拡張機能の説明",
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"permissions": ["storage", "activeTab"],
"host_permissions": ["https://*.example.com/*"],
"background": {
"service_worker": "service-worker.js"
},
"action": {
"default_popup": "popup/popup.html"
},
"content_scripts": [{
"matches": ["https://*.example.com/*"],
"js": ["content.js"]
}]
}
権限(Permissions)
| 権限 | 用途 |
|---|---|
| storage | chrome.storage API |
| tabs | タブ情報へのアクセス |
| activeTab | アクティブタブへの一時アクセス |
| scripting | スクリプト注入 |
| contextMenus | 右クリックメニュー |
| notifications | 通知表示 |
| alarms | 定期実行 |
V2からV3への主な変更点
| 項目 | V2 | V3 |
|---|---|---|
| バックグラウンド | background.page / scripts | background.service_worker |
| リモートコード | 許可 | 禁止 |
| ホスト権限 | permissionsに含む | host_permissionsに分離 |
| Action | browser_action / page_action | action(統合) |
参考文献
[1] Chrome Extensions - Manifest file format
[2] Chrome for Developers - Migrate to Manifest V3
[1] Chrome Extensions - Manifest file format
[2] Chrome for Developers - Migrate to Manifest V3