notifications icon indicating copy to clipboard operation
notifications copied to clipboard

NotificationEvent is not really user constructible

Open saschanaz opened this issue 6 months ago • 2 comments

What is the issue with the Notifications API Standard?

The service-worker-only event's init dictionary requires a Notification object, but its construction is restricted in service workers. Meaning there's no good way to call the constructor.

The new Notification(title, options) constructor steps are:

  1. If this’s relevant global object is a ServiceWorkerGlobalScope object, then throw a TypeError.

saschanaz avatar Apr 24 '25 12:04 saschanaz