add a polyfill for window visibility for smarter display of notifications