polyfill for page visibility api