Hacker News new | ask | show | jobs
by lucaspottersky 2963 days ago
isn't the "Allow website to send Notifications" prompt on 99% of mainstream websites irritating enough?
1 comments

That’s because the api is badly defined, the javascript call to ask for notification is syncronous so the browser need that annoying blocking popup insteas of something less invasive like the popup notification
The javascript call to request notification permissions is async (returning a promise in newer browsers, callback in older ones).

https://developer.mozilla.org/en-US/docs/Web/API/Notificatio...