【发布时间】:2015-08-22 23:37:07
【问题描述】:
当我尝试以弹出窗口的形式打开以下页面时,我遇到了以下消息:
拒绝加载脚本“http://allinternetfinance.com/LetMeKnow/jquery-1.11.2.js”,因为它违反了以下内容安全策略指令:“script-src 'self' 'unsafe-eval'
index.html:4 拒绝执行内联脚本,因为它违反了以下内容安全策略指令:“script-src 'self' 'unsafe-eval'”。启用内联执行需要 'unsafe-inline' 关键字、哈希 ('sha256-anuyZ9J88P7xGyiuMhMfVwpc613qkiD1ZB3UusOLD6A=') 或随机数 ('nonce-...')。”
html 是:
<html>
<head>
<script src="http://allinternetfinance.com/LetMeKnow/jquery-1.11.2.js";></script>
<script>
$( document ).ready(function() {
window.location.replace("http://localhost:8080/MembershipApp/index.html");
});
</script>
</head>
<body>
</body>
我得到的只是白色的小方块,而不是我试图将其重定向到的页面。
【问题讨论】:
-
你是从谷歌扩展运行这个吗?如果不是,那么它可能与某些 XSS HTTP 标头有关:see。
script-src 'self'表示只允许从与当前页面相同的src执行脚本
标签: javascript jquery html google-chrome-extension