Skip to main content
Inspiring
February 6, 2012
Question

Blocking a break out of Iframe

  • February 6, 2012
  • 1 reply
  • 1102 views

I have a site that relies upon keeping a 3rd party site inside an Iframe. The problem is that the site is breaking out of the IFRAME using break out code.

I did some research and could not seem to find a reliable way to stop the 3rd party from breaking out, some of it may actually be caused by a popup that pops over the iframe which also causes a break out.

Anybody have any methods of stopping this?

Thanks

Mark

This topic has been closed for replies.

1 reply

Community Expert
February 6, 2012

I have a site that relies upon keeping a 3rd party site inside an Iframe.

This is a bad reliance to have. Why should your site be able to keep mine inside a frame?

The only way to absolutely, positively avoid this is to fetch the contents via HTTP, rewrite them as desired, then serve them yourself. You can definitely do that from within CF. You might also be able to do that from within your client-side code via AJAX calls, but you might not - that seems a bit dicey. In either case, you may well be violating the terms of use of whatever content you're serving.

Dave Watts, CTO, Fig Leaf Software

Dave Watts, Eidolon LLC
ACS LLCAuthor
Inspiring
February 6, 2012

Hi Dave,

It's actually part of a mobile platform where we run advertisers WAP sites inside our platform, and we have to retain certain control buttons at all times, hence the need for the IFRAME. I don't think re-wrting the content ourselves would be a good idea as it will potentially mess up our tracking.

I'm going to see if our mobile SDK can handle it.