interop
interop copied to clipboard
Notifications API
Description
The Notifications API allows web pages to control the display of system notifications to the end user. These are outside the top-level browsing context viewport, so therefore can be displayed even when the user has switched tabs or moved to a different app. The API is designed to be compatible with existing notification systems, across different platforms. MDN - Notification API
The API has been around for over half a decade and crucial for projects that need to be able to send notifications - they shouldn't just work, they need to be excellent, or projects will opt for native instead of the web.
While all major browser engines now support the Notification API (and related API's like Web Push), there remain a lot of unsupported and experimental features that behave inconsistent across operating systems and browsers.
I would love to see support for features like actions, badge, image, renotify, requireInteraction, silent, tags, etcetera, in all major browsers.
Also, it seems possible to pass MDN compat tests without actually supporting the feature. For example, Safari pushed a single commit that incorrectly marked pretty much every single feature as supported in Safari 16.4. The compat data was later updated, but the table still lists close()
as supported while it is not (you can call the function, it doesn't throw an error, but it doesn't actually do anything either). I think the tests need to be updated so the results are reliable. In the specific case of Safari's close()
implementation, it should be either fixed or changed so developers can rely on feature detection (instead of UA detection) and change behavior of their application accordingly.
Finally, some operating systems make it impossible for browsers to actually respect the Web Push Urgency option. For example, the Chrome team has decided to not wake the device from deep sleep on Android when a high priority push message arrives because it could mean that the Chrome app (and thus, every website that relies on the browser) gets punished by the battery optimization system if a single website goes rogue and spams the user. This means that websites can't notify the user of time-sensitive information, for example if they receive a call (web audio/video calls) or chat messages. I realize that browsers and web specs can't force the operating systems to play nice, but maybe a new permission (time-sensitive web push) is required to support these use cases.
Specification
https://notifications.spec.whatwg.org/
Additional Signals
Existing usage:
- https://chromestatus.com/metrics/feature/timeline/popularity/371
Other Developer Sentiment