8
私はいくつかのドメインから外部スクリプトを読み込むChromeプラグインを開発しています。これらのドメインを許可する方法については、ドキュメントとチュートリアルを調べました。私がチェックしたChromeプラグインのcontent_security_policyに複数のドメインを追加するにはどうすればよいですか?
ドキュメント:
- http://developer.chrome.com/extensions/contentSecurityPolicy.html
- http://www.html5rocks.com/en/tutorials/security/content-security-policy/
- http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#syntax
それはすべて私がmanifest.jsonをして、このルールを作成し、そこから、同じことを言います:
{
// .. general settings
"content_security_policy": "script-src 'self' https://ajax.googleapis.com http://mysite.com; object-src 'self'"
}
このChromeに
は、次のように応答します。私はいくつかの組み合わせを試してみたが、すべて失敗しました。もちろん、
Could not load extension from '/Users/itarato/Desktop/DRC Tutorial Client'.
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
。 1つのドメインのみを使用する場合にのみ機能します。どうすれば追加できますか?
ありがとうございました。本当にありがとうございました。 – itarato