Chrome和IE中的混合内容 [英] Mixed content in Chrome and IE

查看:108
本文介绍了Chrome和IE中的混合内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在启用了HTTPS的网站中,我添加了一个应该显示来自其他网站的内容的iframe,但它不能在https下运行。

In my HTTPS enabled site I have added an iframe that should show content from my other site, but it is not working under https.

<iframe  src="//myothersite.com"></iframe>

在Firefox最新版本中,一切正常。

In Firefox latest version everything works good.

在Chrome中,iframe未加载,并且在控制台中看到以下两个错误:

In Chrome, the iframe isn't loaded and in the console I see these two errors

Mixed Content: The page at 'https://mysite' was loaded over HTTPS, but requested an insecure resource 'http://myothersite.com'. 
This request has been blocked; the content must be served over HTTPS.
Failed to load resource: net::ERR_CACHE_MISS

在IE内容加载不正确的情况下,我看到警报消息;如果我点击允许不安全内容,它会正确加载。

In IE content load incorrectly and I see an alert message; if I click Allow Insecure Content, it loads correctly.

现在的问题是:我如何在IE和Chrome中执行此操作(在没有任何提醒的情况下加载混合内容)?

The question is: how I can do that IE and Chrome as in Firefox (load mixed content without any alerts)?

注意:我没有更改任何浏览器设置。

Note: I haven't changed any browser settings.

推荐答案

实际上Firefox已经开始做同样的事情:如何修复混合内容被阻止的网站

Actually Firefox has started to do the same: How to fix a website with blocked mixed content

这很有道理。如果用户使用HTTPS访问站点期望获得安全体验,并且他可能不知道在不安全连接下加载应用程序的某些部分。这就是浏览器阻止这种不一致的原因。

It makes sense. If the user access a site using HTTPS is expecting to have a secured experience, and he may not be aware of parts of the application loading under not secure connections. That is the reason why the browser blocks such inconsistency.

您需要在myothersite.com上提供HTTPS。

You will need to provide HTTPS on myothersite.com.

这篇关于Chrome和IE中的混合内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆