ExperimentalExperimentalDispatches a Notification lifecycle event ('close' | 'click' | 'show').
Identifies the type of event to emit, and which notificationId to emit it for.
notificationManager.setNotificationHandler((notification) => {
await mockNotificationUi.showNotification(notification);
await notificationManager.dispatchNotificationEvent({
notificationId: notification.notificationId,
type: 'show
})
})
See Also - Notification Click Event (MDN)
See Also - Notification Close Event (MDN)
See Also - Notification Show Event (MDN)
ExperimentalSets the current handler for notifications. The provided function will be invoked whenever a WebContents successfully raises a notification.
Note, only one handler can be used at a time, calling setNotificationHandler will replace any existing registered handler.
The notification handler callback which will be invoked whenever a notification is created.
NotificationManagers allow all HTML5 notifications created in the application to be intercepted and dispatched.
Please note, currently Notifications will only be intercepted if the following conditions are met:
notificationwebAPI permission.Service worker and push notifications are currently not supported.
See also - Notification API (MDN)
This API is subject to change in future releases.