JS Secrets: Anti - Framebuster 2


SUBMITTED BY: Guest

DATE: Dec. 29, 2013, 4:21 a.m.

FORMAT: Text only

SIZE: 386 Bytes

HITS: 1526

  1. //This is an Anti Framebreaker / Framebuster Script
  2. //It prevents framed sites in your page from breaking out of the frame
  3. var framekiller = true;
  4. window.onbeforeunload = function() {
  5. if(framekiller) {
  6. return "Leave this Website?"; // any message that helps user to make decision
  7. }
  8. };
  9. window.onload = function() {
  10. framekiller = false;
  11. };

comments powered by Disqus