如何阻止Gmail最大化iFrame? [英] How to Stop Gmail from maximizing an iFrame?

查看:133
本文介绍了如何阻止Gmail最大化iFrame?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个嵌入了iframe的Gmail网页。不过,Gmail有一些JavaScript代码,只要加载它就会执行。我相信以下js代码片段会导致Gmail劫持窗口并最大化自身,销毁我的父iframe:

I am trying to create a webpage with Gmail embedded in an iframe. However, Gmail has some javascript code that executes whenever it is loaded. I believe the following js code snippet is what causes Gmail to hijack the window and maximize itself, destroying my parent iframe:

if (top.location != self.location) {
  top.location = self.location.href;
}

优选地,我正在寻找一种跨浏览器的解决方案不涉及greasemonkey或其他基于浏览器的黑客)。如果jquery有一些适用的功能/插件,那就太好了。

Preferably, I am looking for a solution that works cross-browser (and does not involve greasemonkey, or some other browser-based hack). If jquery has some applicable function/plugin, that would be great.

推荐答案

Jeff Atwood提出的SO问题解决了这个问题(但有点反过来):框架巴斯特巴斯特...需要巴斯特代码

There is an SO question by Jeff Atwood that addresses this (but kind of in reverse): Frame Buster Buster ... buster code needed

这篇关于如何阻止Gmail最大化iFrame?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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