将移动Google放入iframe无效 [英] Putting mobile Google into an iframe does not work

查看:179
本文介绍了将移动Google放入iframe无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下链接后面是Google的移动视图: Google的移动网站.

Behind the following link is the mobile view of Google: Google's mobile site.

我试图将其放在网站上的iframe中,但不起作用.

I tried to put it in an iframe on my website, but it doesn't work.

<iframe id="google_search" src="http://m.google.at/search?hl=de&safe=on&q=stackoverflow" style="width: 400px; height: 600px; overflow:scroll; border: 1px solid black;"></iframe>

我得到的只是一个空的iframe.为什么?

All I get is an emty iframe. Why?

推荐答案

我怀疑Google正在发送设置为denyX-FRAME-OPTIONS标头.这样可以防止页面在IE8 +以及FireFox,Opera和Chrome的较新版本中加载到框架中(目前确切的版本号使我无法使用).

I would suspect that Google is sending the X-FRAME-OPTIONS header set to deny. This prevents the page from loading in a frame in IE8+ and newer versions of FireFox, Opera, and Chrome (the exact version numbers escape me at the moment).

通常这样做是为了打击ClickJacking. IEBlog上有一篇很棒的文章: IE8安全性第七部分:ClickJacking防御措施

This is usually done to combat ClickJacking. The IEBlog has a great article on this: IE8 Security Part VII: ClickJacking Defenses

这篇关于将移动Google放入iframe无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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