Skip to content Skip to sidebar Skip to footer

Detect If Remote Website Is Frameable

I want to detect if remote website allows to stand under iframe or not. For example if website does not want to show content under iframe (amazon.com item details page) or if they

Solution 1:

I think there's no such way. You cannot inspect a content of iframe loaded from another domain - and even if you could, it still will be dependent of what exactly the owner of the site decided to put in there. What if someone will design their 'iframed' content exactly the same way as original - but with all page's text encoded in ROT13, for example?

Solution 2:

The following is one of the Javascript codes used to prevent pages to be displayed in iframe.

if (top.location.href != self.location.href)
  top.location.href = self.location.href;

If it is an include file, it will not be easy to detect it..

Post a Comment for "Detect If Remote Website Is Frameable"