When getting a site audited a few years ago for security by my merchant processor, they required me to put this code at the top of the head section of each page:
<style id="antiClickjack">body{display:none !important;}</style>
<script type="text/javascript">
if (self === top) {
let antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>
When testing a new version of the site, and using a chrome extension to turn off javascript (called "Quick Javascript Switcher"), the page appears blank, so it seems this antiClick jack method makes the page not work if javascript is disabled. I'm not even sure how click jacking works, but am wondering if removing the display:none will allow users with javascript disabled to still use the site while also serving the antiClick jack purpose, or if there's a better way to prevent click jacking.