added Page Visibility API to hide notifications when tab is open