title: window.onFocus intermittently doesn't fire on Chrome
body: <p>I'm trying to determine whether or not a tab is focused, for a chatroom app. I have:</p>
  
  <pre><code>window.onfocus = function () {
    isActive = true;
  };
  window.onblur = function () {
    isActive = false;
  };
  </code></pre>
  
  <p>This works perfectly in Firefox and even in IE. But in Chrome, it only works intermittently; sometimes the event will fire, sometimes not. It will always fire if I click on a different window then click back to the Chrome window; but switching tabs doesn't always do it. </p>
  
  <p>What can I do about this?</p>
  
  <p>See live example here: <a href="http://holyworlds.org/new_hw/chat/onfocus.html" rel="nofollow">http://holyworlds.org/new_hw/chat/onfocus.html</a></p>