【发布时间】:2020-11-28 04:00:24
【问题描述】:
我不知道如何将我的 chrome 扩展清单 v2 升级到 v3
我检查了https://developer.chrome.com/extensions/migrating_to_manifest_v3,但它没有提到 manifest.json
知道我的清单中需要更改什么:-
"name": "My Extension",
"version": "1.0.0",
"short_name": "Ex",
"author": "User",
"description": "cool chrome ex",
"browser_action": {
"default_title": "ex",
"default_icon": "img/logo.png"
},
"options_page": "options.html",
"options_ui": {
"page": "options.html",
"open_in_tab": true
},
"background": {
"scripts": [
"js/background.js"
]
},
"permissions": [
"tabs",
"background",
"storage"
],
"icons": {
"128": "img/logo128.png"
},
"content_scripts": [
{
"run_at": "document_end",
"matches": [
"https://conferfly.com/*",
"https://meet.google.com/*",
"https://teams.microsoft.com/*",
"https://*.zoom.us/*"
],
"js": [
"js/main.js",
"js/injected.js"
],
"css": [
"css/main.css"
]
}
],
"web_accessible_resources": [
"js/options.js",
"js/main.js",
"js/injected.js"
],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
}
提前谢谢你
这是用于conferfly 扩展
【问题讨论】:
-
它说“用 manifest.json 中的 background.service_worker 替换 background.page 或 background.scripts。注意 service_worker 字段采用字符串,而不是字符串数组。”当然,将 manifest_version 中的 2 更改为 3。