Mixed Content Blocking导致Firefox23 无法显示iframe问题
前些天遇到了一个神奇的问题:有个网页包含了iframe,之前一直运行良好,但是Firefox升级到最新的23.0版本后,发现iframe内的内容变成空的了!查看元素iframe里只有<html><body></body></html>。其他浏览器都没有问题。
原因
stackoverflow上有人说是因为使用了样式display:none;的缘故:
In google chrome the div contains an inline style of
display:block
(and a background-image). But in firefox the div it doesn't have thedisplay:block
(only the background image). So, the problem is that teir scripts are not "showing" the map's div.
see http://stackoverflow.com/questions/13790728/iframe-not-working-in-firefox
查了iframe src引用的网页源码,确实有这个样式!但是,把它去掉后,问题依旧。。。
后来偶然发现控制台上有打印:
点击地址栏的盾牌图标,选择Disable Protection on This Page;就会显示iframe;之后这个盾牌图标会变成一个感叹号图标。
解决方案3但上述方案只对当前session有效,重启浏览器后又会被阻止。要让Firefox默认不阻止:
地址栏输入about:config进入配置页面,找到security.mixed_content.block_active_content,把它设为false。