Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
JS Secrets: Anti - Framebuster
SUBMITTED BY:
Guest
DATE:
Dec. 29, 2013, 3:39 a.m.
FORMAT:
JavaScript
SIZE:
563 Bytes
Raw
Download
Tweet
HITS:
1322
Go to comments
Report
//This is an Anti Framebreaker / Framebuster Script
//It prevents framed Sites in your page from breaking out of the Frame
var
prevent_bust
=
0
;
// Event handler to catch execution of the busting script.
window
.
onbeforeunload
=
function
()
{
prevent_bust
++
};
// Continuously monitor whether busting script has fired.
setInterval
(
function
()
{
if
(
prevent_bust
>
0
)
{
prevent_bust
-=
2
;
// Get a 'No Content' status which keeps us on the same page
window
.
top
.
location
=
'about:blank'
;
}
},
1
);
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus