JavaScript - Is it possible to view all currently scheduled timeouts?
<p>So I was wondering, is there any feasible way in JavaScript to view information about scheduled timeouts and intervals that you don't explicitly know about (I know <code>setTimeout</code> and <code>setInterval</code> return a handle that can be used to refer to the scheduled instance, but say that this is unavailable for one reason or another)?  For instance, is there a way to use a tool like Chrome's JavaScript console to determine what timeouts are currently active on an arbitrary page, when they will fire, and what code will be executed when they fire?  More specifically, say a page has just executed the following JavaScript:</p>

<pre><code>setTimeout("alert('test');", 30000);
</code></pre>

<p>Is there some code I can execute at this point that will tell me that the browser will execute <code>alert('test');</code> 30 seconds from now?</p>

<p>It seems like there theoretically should be some way to get this information since pretty much everything in JavaScript is exposed as a publicly accessible property if you know where to look, but I can't recall an instance of ever doing this myself or seeing it done by someone else.</p>
