An answer to \"Foolproof way to detect if iframe is cross domain\" describes a method to test if an iframe on a page points to a same-domain or cross-domain page, working ar
If I see your use case:
I would check it server side (who called your site), using $_SERVER['REMOTE_ADDR']
, and if it is your IP than you can hide branding and links backs.
If the use case is about to prevent framing your site you can use X-Frame-Options: deny
.
Other guess:
Elements inside a document have a ownerDocument
property, maybe that can help detecting what you want.