3 ms·
How does one set their website to be iframe unfriendly? Intriguing.
by artursapek 14y ago
How does one set their website to be iframe unfriendly? Intriguing.
- regecks 14y agoThe Google Play store tells the browser what framing policy to use with X-Frame-Options (https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Option...): x-frame-options:SAMEORIGIN However you could also check for: window.top == window
- abrkn 14y agoif (window.top !== window) { window.top.location = window.location } It's useful if your website is being iframed to display ads or exploited with cross window communication security holes (old school) http://i.imgur.com/ePFbiIT.png http://i.imgur.com/ePFbiIT.png
- justindocanto 14y agoWould it be wrong of me to implement on the site to prevent that from happening? haha