michoel
06/08/2017, 12:49 AMNS.jQuery(function() {
function check_alert(message) {
var IGNORED_ALERTS = [
/^Customer is \d+ days overdue\.$/,
/^The following items are currently out of stock/,
];
return IGNORED_ALERTS.some(function(regex){
return regex.test(message);
});
}
var nalert = window.alert;
window.alert = function() {
if (check_alert(arguments[0])) {
console.log('Alert suppressed - ' + arguments[0]);
} else {
return nalert.apply(this, arguments);
}
};
});