is it possible to prevent iframe content from esca

2019-08-14 08:55发布

it is often done by code like this:

if ( window.parent.frames.length>0 )  {}  // check how many frames, if none do nothing
else {
   window.location="[new destination]";  // else change the current location
}

But I want to prevent iframe content from knowing that it is on the iframe. I am writing a php proxy and content will be from the same domain and I know that I have an option to remove instances of escaping code one by one using server side code but maybe is there an option to do it in js.

1条回答
We Are One
2楼-- · 2019-08-14 09:28

The problem even has it's own wikipedia page http://en.wikipedia.org/wiki/Framekiller

查看更多
登录 后发表回答