2

我正在尝试创建一个使用 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.
4

1 回答 1

0

您将需要使用沙盒中的 API ,或者更有可能在webview中使用。

于 2013-08-21T22:49:43.340 回答