3 ms·
You'll also want to track the pageshow and pagehide events (because of PageCache), and note that prerender is now obsolete. Browsers no longer support it and th
by bluesmoon 9y ago
You'll also want to track the pageshow and pagehide events (because of PageCache), and note that prerender is now obsolete. Browsers no longer support it and the spec is dead.
boomerang has been using PageVisibility for as long as the API has existed, and also handles the prerender case for when browsers did support it. The source is open if you'd like to see how we do it: https://github.com/soasta/boomerang https://github.com/soasta/boomerang