Last active
March 17, 2018 20:34
-
-
Save idmontie/620219b89db47f9324cc23dd72ca795c to your computer and use it in GitHub Desktop.
Make sure you aren't iframed!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Crazy, but consistent method: --> | |
<style> | |
body { display: none; } | |
</style> | |
<script> | |
if (self === top) { | |
documents.getElementsByTagName("body")[0].style.display = 'block'; | |
} else { | |
top.location = self.location; | |
} | |
</script> | |
<!-- Inconsistent method: --> | |
<script> | |
if (top.location != location) { | |
top.location = self.location; | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X-Frame-Options: DENY prevents framing code at all | |
X-Frame-Options: SAMEORIGIN prevents framing by external sites | |
X-Frame-Options: ALLOW-FROM origin allows framing only by the specified origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment