mobilusoss / react-web-notification

React component with HTML5 Web Notification API
http://mobilusoss.github.io/react-web-notification
MIT License
270 stars 82 forks source link

Prefer document.hasFocus() to tracking focus/blur events #97

Open mikol opened 2 years ago

mikol commented 2 years ago

document.hasFocus() is supported across the board and will be more reliable/correct than tracking state based on focus/blur events. Additionally, it means that Notification component users won’t need to initialize an empty element (<Notification disableActiveWindow title=''/>) in order for the component to properly track window activity.