I’m developing a Greasmonkey Script and I need to hide/suppress a confirm box. Here’s the code:
setInterval(function () {
bla bla bla
var Element = document.getElementById("id");
Element.click();
bla bla bla
}, 2000); //Perform Actions x2000MS = 2.0Secs
}
When the script clicks on the element, the browser shows a confirm box that stops the script. How can I remove it?
I’ve tried with window.confirm = function () {}; without success. What can I do?
Essentially, when the
confirmmethod is called, have itreturn false:That will remove any default behaviors.