我无法为google earth打包应用设置content_security_policy

时间:2013-08-21 21:20:06

标签: google-chrome google-chrome-extension manifest google-earth google-chrome-app

我正在尝试创建一个使用google earth API的打包应用。但是,在运行应用程序时,我收到一条错误消息:

Refused to load the script 'https://www.google.com/jsapi' because it violates the following Content Security Policy directive: "default-src 'self' chrome-extension-resource:". Note that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.

所以我在清单中添加了一行

"content_security_policy": "script-src 'self' https://www.google.com/jsapi; object-src 'self'",

然而,现在chrome抱怨并显示以下错误:

There were warnings when trying to install this extension:
'content_security_policy' is only allowed for extensions and legacy packaged apps, and this is a packaged app.

1 个答案:

答案 0 :(得分:0)

您需要使用sandbox中的API,或更可能使用webview中的API。