JS Secrets: Anti - Framebuster


SUBMITTED BY: Guest

DATE: Dec. 29, 2013, 3:39 a.m.

FORMAT: JavaScript

SIZE: 563 Bytes

HITS: 1322

  1. //This is an Anti Framebreaker / Framebuster Script
  2. //It prevents framed Sites in your page from breaking out of the Frame
  3. var prevent_bust = 0;
  4. // Event handler to catch execution of the busting script.
  5. window.onbeforeunload = function() { prevent_bust++ };
  6. // Continuously monitor whether busting script has fired.
  7. setInterval(function() {
  8. if (prevent_bust > 0) {
  9. prevent_bust -= 2;
  10. // Get a 'No Content' status which keeps us on the same page
  11. window.top.location = 'about:blank';
  12. }
  13. }, 1);

comments powered by Disqus