now using the page visibility API for notifications