zzz
zzz

Reputation: 2634

How to Stop Gmail from maximizing an 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;
}

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.

Upvotes: 2

Views: 4128

Answers (2)

DanSingerman
DanSingerman

Reputation: 36532

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

Upvotes: 1

Jawa
Jawa

Reputation: 2332

As the code Gmail uses is located in a block it's hard to prevent it from running. There might be some useful insights in an article about preventing frame-busting.

Upvotes: 1

Related Questions