Search code examples
javascriptwebkitsettimeoutalertconfirm

setTimeout() firing prematurely when showing an alert() in Chrome


I have the following code:

t = setTimeout(function () { blah();  }, 900000);

Which, basically, calls blah after 15 minutes of the page having loaded.

However, if at some point I show an alert() or a confirm(), then as soon as it is dismissed, blah() gets executed for some reason.

As far as I've seen, this only happens in Safari/Chrome. It doesn't happen in IE/Firefox.

Any ideas what's going on, or even better, how to solve this?

Thanks!
Daniel


Solution

  • You are not alone, this is the bug: code.google.com/p/chromium/issues/detail?id=43796