0

When using Chrome I can disable setTimeout for windows or individual frames by overriding the setTimeout function like this window.frames['frame0'].setTimeout = function() {}

Is there a way to achieve a similar effect with IE?

I'd like to be able to do this from the JavaScript console as I don't have access to modify the JS that is setting the timers but I need to be able to debug the page.

I found the following excellent discussion but it would appear that the technique mentioned must be called before other scripts are loaded. http://www.adequatelygood.com/2011/4/Replacing-setTimeout-Globally

chillitom
  • 24,888
  • 17
  • 83
  • 118
  • ouch. I'm sure you've got a good reason for wanting to do this, but you do realise it's going to break a lot of stuff? (including libraries like JQuery, which uses it extensively) – Spudley May 09 '11 at 16:08
  • yes, don't worry, this falls into the category "useful whilst debugging" – chillitom May 09 '11 at 16:13
  • I want to drive the page programmatically for testing reasons. I need it to be deterministic so can't have timers firing at will. – chillitom May 09 '11 at 16:35
  • probably This Link May helpful for You. http://stackoverflow.com/questions/3847121/how-can-i-disable-all-settimeout-events?rq=1 – Arunkumar Apr 04 '13 at 06:22

0 Answers0