I need to stop all javascript running on the page, but I have a limitation:
I can’t manage the content of the tags, I edit the page after loading it.
In addition, I need to delete all the variables defined by the old script that was running, and stop all intervals.
The solution I decided to stop the intervals:
for(var i=0,s=setInterval(function(){},1e10);i<=s;++i)
clearInterval(i);
for(var i=0,s=setTimeout(function(){},1e10);i<=s;++i)
clearTimeout(i);
user216441
source
share