【发布时间】:2014-04-20 17:20:20
【问题描述】:
在chrome-extension://<EXTENSION_ID>/hello.html内,代码如下:
<script> alert("hi"); </script>
JS 不工作? 如何让它发挥作用?
【问题讨论】:
标签: javascript google-chrome google-chrome-extension
在chrome-extension://<EXTENSION_ID>/hello.html内,代码如下:
<script> alert("hi"); </script>
JS 不工作? 如何让它发挥作用?
【问题讨论】:
标签: javascript google-chrome google-chrome-extension
您不能在 Chrome 扩展程序中使用内联 JavaScript,因为强制执行 Content Security Policy。
你需要摆脱它,把它放在一个外部 JS 文件中。
【讨论】: