我在开发者控制台中遇到了一堆错误:
拒绝评估字符串
拒绝执行内联脚本,因为它违反了以下内容安全策略指令
拒绝加载脚本
拒绝加载样式表
这是怎么回事?内容安全策略如何运作?我如何使用Content-Security-PolicyHTTP标头?
具体来说,如何......
file://协议?<style>和<script>?eval()?最后:
'self'意思?html javascript security http-headers content-security-policy
在我的系统中更新Cordova 5.0后,我创建了新的应用程序.当我在设备上测试我的应用程序时,我在控制台日志中出现错误:
No Content-Security-Policy meta tag found.
Please add one when using the Cordova-plugin-whitelist plugin.: 23.
Run Code Online (Sandbox Code Playgroud)
我在head部分添加了meta
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src: 'self' 'unsafe-inline' 'unsafe-eval'>
Run Code Online (Sandbox Code Playgroud)
但同样,我在使用应用程序内浏览器插件和其他7个网站链接的应用程序中得到了同样的错误.