【发布时间】:2021-04-16 19:01:37
【问题描述】:
我正在尝试创建一个 chrome 扩展。我的清单文件是
{
"name": "Alert-Beep",
"action": {},
"manifest_version": 3,
"version": "0.1",
"description": "Beeps if alert() is called",
"content_security_policy": "script-src 'self'; object-src 'self'",
"permissions": [
"activeTab",
"scripting"
],
"content_scripts": [
{
"matches": ["https://*.com/*"],
"js": ["alert-beep.js"],
"run_at": "document_start"
}
]
}
加载扩展失败并显示消息
Failed to load extension
File
~\alert-beep
Error
Invalid value for 'content_security_policy'.
Could not load manifest.
我做错了什么?
【问题讨论】:
-
查看migration guide:CSP 现在是一个字典对象。
-
谢谢。我还发现这个答案很有帮助stackoverflow.com/questions/63308160/…
标签: javascript google-chrome-extension manifest.json