Specify the keywords in the standard alert in the include function in the following snippet. It will block the standard alert that we specified using keywords.
const oldAlert = window.alert;
window.alert = function(text) {
console.log(text);
if (!text.includes("back"))
oldAlert(text);
return true;
};