whatwg / notifications

Notifications API Standard
https://notifications.spec.whatwg.org/
Other
138 stars 49 forks source link

Define what happens when the notification platform fails to show the notification #200

Open saschanaz opened 9 months ago

saschanaz commented 9 months ago

What is the issue with the Notifications API Standard?

Running new Notification('\f').onerror = console.error; on browsers on Windows fails to put the notification to Action Center as Windows somehow rejects form feed character. Firefox and Chrome have different behavior:

  1. Firefox silently falls back to non-native notification. Well good, but the notification just disappears soon and the webpage will never know what really happened.
  2. Chrome just silently does nothing at all, showing no notification.

Notification has an error event handler but the spec only uses it to tell the lack of the permission. Perhaps it should also be used to tell whether the notification is failed to be created by system limitation.

annevk commented 2 months ago

It seems like that might allow for determining aspects about the system. I'd rather not reveal such information to callers.

(The error event is also exclusively used today to say something about the permission state.)