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

查看:23
本文介绍了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.

问题是:我怎样才能像在 Firefox 中那样处理 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天全站免登陆