Break out of Frames - WITHOUT Javascript!


This is a question about how to do something WITHOUT Javascript but I guess this is still the best forum to ask.

There are tons of examples how to break out of frames with Javascript and I thought you couldn’t do it without Javascript.

But YAHOO! does it! If you place inside an iframe and click on an item in the Navigation (say Autos) it breaks out of the frame even if Javascript is disabled in the browser. Works for both IE and Firefox.

The page redirects with a Location header a couple of times, but I tested that and it’s not what is causing it to break out.

To test simply create an html file on your desktop with the following contents:

  <h1>My Iframe</h1>
  <iframe src=""></iframe>

Disable Javascript in your browser, open this page and click on any of the links inside, they break of the iframe.

Anyone knows or can figure out how they do it?

Thanks guys

Ok, I guess it can be done by having the links in the page inside the iframe do <a href=“…” target=“_top”>. But yahoo doesn’t do that, it must be doing it some other way, though I guess that’s as good a solution as any.

However they did whatever it is you claim they did their site just displays in the iframe in Firefox even wwith JavaScript enabled.

Even if you found out how they did this, what are you going to do with that knowledge?