Refused to load the script because it violates the following Content Security Policy directive
2018-01-15 17:52
721 查看
由于需要,使用Cordova来做一个Android的Demo,同时使用到了外网js文件。运行后没有预期的效果,还报错:
Refused to load the script because it violates the following Content Security Policy directive
查到这篇文章,解释的很详细,但是缺少实际demo。最后在这里搜到答案:https://stackoverflow.com/questions/31211359/refused-to-load-the-script-because-it-violates-the-following-content-security-po,即:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' http://* 'unsafe-inline'; script-src 'self' http://* 'unsafe-inline' 'unsafe-eval'" />
Refused to load the script because it violates the following Content Security Policy directive
查到这篇文章,解释的很详细,但是缺少实际demo。最后在这里搜到答案:https://stackoverflow.com/questions/31211359/refused-to-load-the-script-because-it-violates-the-following-content-security-po,即:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' http://* 'unsafe-inline'; script-src 'self' http://* 'unsafe-inline' 'unsafe-eval'" />
相关文章推荐
- because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'". Note that 'script-src' was not explicitly set, so 'default-s
- 拒绝访问:because it violates the following Content Security Policy directive: "defaul
- Cordova页面解析页面中script 内容失败,Refused to execute inline script because it violates the following
- 关于'It violates the following Content Security Policy directive: ‘iframe-src'’
- Cordova页面解析页面中script标签内容失败,Refused to execute inline script because it violates the following
- Chrome插件在页面上直接绑定JavaScript事件提示Refused to execute inline event handler because it violates the following Co
- 有关This application failed to start because it could not find or load the Qt platform plugin "windows
- 移植Qt5.7在开发板上运行Qt程序提示This application failed to start because it could not find or load the Qt platfo
- This application failed to start because it could not find or load the Qt platform plugin "windows"
- This application failed to start because it could not find or load the Qt platform plugin "xcb".
- This application failed to start because it could not find or load the Qt platform plugin "xcb"问题解决方
- QT5:his application failed to start because it could not find or load the Qt platform plugin "xcb"
- This application failed to start because it could not find or load the Qt platform ...
- This application failed to start because it could not find or load the Qt platform plugin "xcb" in "
- UG12.0安装完成后Application failed to start because it could not find or load the QT platform的解决办法
- This application failed to start because it could not find or load the Qt platform plugin "xcb".
- This application failed to start because it could not find or load the Qt platform plugin "xcb" in "
- This application failed to start because it could not find or load the Qt platform plugin "xcb".
- This application failed to start because it could not find or load the Qt platform plugin "xcb" in "
- This application failed to start because it could not find or load the Qt platform plugin “windows”错