Skip to content

Instantly share code, notes, and snippets.

@tuxracer
Created April 25, 2012 17:57
Show Gist options
  • Save tuxracer/2491691 to your computer and use it in GitHub Desktop.
Save tuxracer/2491691 to your computer and use it in GitHub Desktop.
(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