今天早上,当我将Firefox浏览器升级到最新版本(从22升级到23)时,我的后台办公室(网站)的一些关键方面停止了工作。

查看Firebug日志,报告了以下错误:

Blocked loading mixed active content "http://code.jquery.com/ui/1.8.10/themes/smoothness/jquery-ui.css"
Blocked loading mixed active content "http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"`

在其他错误中,由上述两个中的后者未加载引起。

上述问题是什么意思?我该如何解决?


当前回答

我只是通过在头部添加以下代码来修复这个问题:

    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

其他回答

将下面的<meta>标记放入文档的<head>部分,强制浏览器将不安全连接(http)替换为安全连接(https)。如果连接能够使用https,这可以解决混合内容的问题。

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

如果你想要阻塞,那么将下面的标签添加到<head>标签中:

<meta http-equiv="Content-Security-Policy" content="block-all-mixed-content">

如果你的应用服务器是weblogic,那么确保WLProxySSL ON条目存在(也要确保它不应该被注释)在webserver的conf目录下的weblogic.conf文件中。然后重新启动web服务器,它将工作。

我发现,如果你在包含或混合http://www.example.com之类的页面时遇到问题,你可以通过放置//www.example.com来解决

由于安全性,它给出了误差。 为此,请在网站url中使用“https”而不是“http”。

例如:

   "https://code.jquery.com/ui/1.8.10/themes/smoothness/jquery-ui.css"
   "https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"
@if (env('APP_DEBUG'))
        <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
@endif

Laravel Blade的语法,请记住仅用于调试以避免MITM攻击和窃听

也使用

http -> https

对于Ajax或普通JS脚本或CSS也将解决这个问题。