0
当上传我的解压后的Chrome扩展程序,我得到以下错误:Chrome的插件和内容安全策略的错误
Could not load extension from '/Users/me/example'. Invalid value for 'content_security_policy': Both 'script-src' and 'object-src' directives must be specified (either explicitly, or implicitly via 'default-src'), and both must whitelist only secure resources. You may include any of the following sources: "'self'", "'unsafe-eval'", "http://127.0.0.1", "http://localhost", or any "https://" or "chrome-extension://" origin. For more information, see http://developer.chrome.com/extensions/contentSecurityPolicy.html
我的清单如下所示:
{
"name": "Example Inc.",
"manifest_version" : 2,
"version": "0.4.4",
"content_scripts": [
{
"matches": [
"*://*.example.cc/*"
],
"js": [
"production/jquery.libs.min.js",
"https://example.cc/js/example.js"
],
"run_at": "document_end"
}
],
"permissions": [
"*://*.example.cc/*",
"tabs",
"activeTab",
"contextMenus",
"storage",
"management",
"cookies"
],
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com/ga.js https://example.cc/js/*; object-src 'self'"
}
从我的所有例子我看过了,在阅读了一些CSP文档后,我不确定我错过了什么。我们的域名是完全https,example.js文件存在并且可以访问等。
欢迎任何想法!
为了使这更好的答案,说明了什么问题。 – Xan
使用此条目时,尝试上传时出现以下错误:无法从'/ Users/me/example'加载扩展名。无法加载JavaScript内容脚本。 – dylst