title: Why does iOS Safari fire window focus event twice?
body: <p>I have the following code on a page:</p>
  <pre><code>var i = 0;
  window.addEventListener(&quot;focus&quot;, function(event) { 
    document.body.innerHTML = &quot;Focus count = &quot; + i++;
  }, false);
  </code></pre>
  <p>On desktop this increments correctly (1,2,3 etc) when switching tabs (or any window blurring/focusing action)</p>
  <p>However, when I switch tabs on ios safari the event appears to be firing twice (1,3,5,7 etc)</p>
  <p>Why is this happening?</p>