ShvedAn
12/4/2018 - 5:41 AM

clickjacking framebusting

<style id="antiClickjack">body{display:none !important;}</style>
<script type="text/javascript">
//clickjacking framebusting
  (function() {
    "use strict"
    function unlock() {
      var antiClickjack = document.getElementById("antiClickjack");
      antiClickjack.parentNode.removeChild(antiClickjack);
    }
    if (top == self) { // page is not embedded
      unlock();
    } else { // page embedded, check for same domain
      try { // try to access a property of parent to check same domain
        var loc = parent.location.href;
        unlock();
      } catch (e) { } // fail gracefully and stay hidden
    }
  })();
</script>