Skip to content

Instantly share code, notes, and snippets.

View carlcalderon's full-sized avatar

Carl Calderon carlcalderon

  • Stockholm, Sweden
View GitHub Profile
@carlcalderon
carlcalderon / gist:3912567
Created October 18, 2012 15:28 — forked from paulirish/gist:3910471
page visibility API : tribulations with prefixes
// this is the least sucky way i could think of to
// detect and deal with a cross-browser impl of the page visibility api
// forks welcome.
function getHiddenProp() {
if ('hidden' in document) return 'hidden';
var prefixes = ['webkit','moz','ms','o'],
len = prefixes.length,