How to remove specific standard alerts?

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;
            };

Leave a comment

Your email address will not be published. Required fields are marked *