Skip to content

Instantly share code, notes, and snippets.

@nickjacob
Created June 25, 2013 17:04
Show Gist options
  • Save nickjacob/5860265 to your computer and use it in GitHub Desktop.
Save nickjacob/5860265 to your computer and use it in GitHub Desktop.
really basic framekiller
;(function (window) {
if (window.top !== window.self) {
killFrame();
}
var _frame_ = "<html><head><title>Not Allowed</title>\
</head><body><h1>We don't allow This</h1></body></html>";
function killFrame() {
document.open();
document.write(_frame_);
document.close();
// seriously fuck up any other scripts
window.confirm = window.alert = function(){};
undefined = 1; window.onload = null;
window.onbeforeunload = null;
// lets hope these work
window.addEventListener = function(){};
window.attachEventHandler = function(){};
}
}(window));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment