Chrome 18+ 版:如何使用内容安全策略允许内联脚本? [英] Chrome version 18+: How to allow inline scripting with a Content Security Policy?
本文介绍了Chrome 18+ 版:如何使用内容安全策略允许内联脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Chrome 18 Dev/Canary 刚刚发布,,您可以使用描述的技术
进一步调查
我还测试了将适用的指令放在 meta
标签而不是清单中.虽然控制台消息中指示的 CSP 确实包含标签的内容,但它不会执行内联脚本(在 Chrome 53 中).
新的background.html:
<头><meta http-equiv="Content-Security-Policy";content="script-src 'self' 'sha256-WOdSzz11/3cpqOdrm89LBL2UPwEU9EhbDtMy2OciEhs='">头部><身体><script>alert('foo');</script>