【发布时间】:2021-08-01 02:12:50
【问题描述】:
我已在控制台中粘贴以下代码尝试导入 jQuery:
var jq = document.createElement("script");
jq.src = "http://code.jquery.com/jquery-3.6.0.min.js";
document.getElementsByTagName("head")[0].appendChild(jq);
然而这个输出显示:
Loading failed for the <script> with source "http://code.jquery.com/jquery-3.6.0.min.js".
Content Security Policy: The page's settings blocked the loading of a resource at http://code.jquery.com/jquery-3.6.0.min.js ("script-src").
我似乎需要启用混合内容,正如the MDN article 所说:
- 点击地址栏中的挂锁图标。
- 单击站点信息面板中的箭头。
- 点击暂时禁用保护。
但是没有暂时禁用保护按钮,就好像它从未尝试加载混合内容一样。
这是一个错误吗?为什么我无法在控制台中启用混合内容?
【问题讨论】:
标签: javascript firefox firefox-developer-tools mixed-content