【发布时间】:2016-12-01 21:34:07
【问题描述】:
我的 phonegap 应用在使用 phonegap 4.0 时运行良好。
刚刚升级到 6.0,使用相同的代码。这些从自己加载的图像被加载,但那些从外部 http 加载的图像没有被加载。例如http://www.hihi.com。我尝试更改元 CSP 设置和 config.xml,都没有帮助。
config.xml
<access origin="*"></access>
<allow-navigation href="http://*/*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="*" />
index.html(添加了img-src *)
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline';img-src *; style-src 'self' 'unsafe-inline'; media-src *" />
还有其他原因吗?我正在从 phonegap 桌面服务器和 phonegap 移动应用程序运行
【问题讨论】:
-
好的。是不是因为 phonegap 桌面服务器应用程序覆盖了我们自己的 CSP 设置。链接github.com/phonegap/connect-phonegap/issues/163
-
安装到手机就可以使用
标签: image cordova content-security-policy