Created
April 25, 2012 17:57
-
-
Save tuxracer/2491691 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
// Temporary alert box killer - Derek Petersen | |
// Store the native alert/confirm functions for later | |
var _nativeAlert = window.alert; | |
var _nativeConfirm = window.confirm; | |
// Disregard all alert boxes | |
window.alert = function() { | |
return; | |
}; | |
// Say "No" to all confirm boxes | |
window.confirm = function () { | |
return false; | |
}; | |
// Restore native alert/confirm functions after a couple seconds | |
// after the page loads | |
window.onload = function() { | |
setTimeout(function() { | |
window.alert = _nativeAlert; | |
window.confirm = _nativeConfirm; | |
}, 2000); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment