BenM
BenM

Reputation: 53246

Prevent iframe breakout HTML 5 / JS

I am currently working on a Chrome Extension that mimics the behaviour and functionality of Firefox's Responsive Design View.

Everything is almost finished, and generally working well. However, I ran into a problem that I'd like to circumvent if possible. I have used an iframe that users can manipulate in terms of size, etc., but certain sites (including StackOverflow) do not allow themselves to be embedded in Frames (warning about security).

Does anyone have a solution to prevent this behaviour? I do not want to use server-side code for this. Removing the iframe in favour of another method is also fine.

Upvotes: 0

Views: 302

Answers (1)

PhonicUK
PhonicUK

Reputation: 13874

This behavior cannot be overridden, quite deliberately. If a site declares that it doesn't want to allow itself to be embedded in frames, there is precisely nothing you can do about it.

Upvotes: 3

Related Questions