oddworks blog

The Page Visibility API

How a page knows you left: document.hidden, visibilitychange, focus and frame timing, with code.