I'm using the HTML5 Notification API to show a message if new content is available. I'd like to show the browser tab that caused the notification to be activated when the user clicks the message, but I haven't been able to find an API to do so. I did find the Page Visibility API, but it only seems to send events when tabs change, not allow me to activate a tab.
Is it possible to control the browser like this, or is it simply not allowed?
If anything, window.focus()
should do it from inside the notification's click
event handler.
See https://notifications.spec.whatwg.org/#activating-a-notification for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With