title: Javascript performance when running in an unfocused tab
body: <p>It seems like there has been a change to some recent version of Chrome and Firefox*, and now Javascript execution seems to be different when the tab it is being run in is not the currently focused one.</p>
  
  <p>When I run my Javascript unit tests, they normally take about 20 seconds to complete but now, when the tab is unfocused, it takes upwards of 2000 seconds. What is strange though, is that the run times for each individual test are not affected (most are still &lt; 10ms). The test runner I'm using adds a <code>setTimeout(0)</code> between running each test so that the browser doesn't lock up while executing, and so that seems the likely culprit.</p>
  
  <p>Is there a way to tell the Javascript engine not to "deprioritise" that tab though? It's nice to be able to run my tests in the background without having to watch myself...</p>
  
  <p>*<em>sorry, I don't really care enough to try installing old versions to find when this started happening. At the very least, it's happening now on Firefox 5.0 and Chrome 12.</em></p>