您的位置:首页 > 其它

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'" />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐