Lock javascript lock

I am working on a website using wide javascript. The code I'm working on also depends on other large javascript libraries. The fact is that somewhere in these libraries a warning window appears.

I was wondering if there is a way to disable the javascript warning window on the fly and enable it again later.

thank

+3
source share
1 answer

Save the old function alertfor the variable.

_alert=alert;

Then install the old alertor nullcustom function.

alert=function(){};
/*or*/
alert = null;

To restore the original version alert, simply undo step 1.

alert=_alert
+5
source

Source: https://habr.com/ru/post/1740029/


All Articles