NotificationEvent: action property - Web APIs | MDN
Value
A string.
Examples
js
self.registration.showNotification("New articles available", {
actions: [{ action: "get", title: "Get now." }],
});
self.addEventListener("notificationclick", (event) => {
event.notification.close();
if (event.action === "get") {
synchronizeReader();
} else {
clients.openWindow("/reader");
}
});
Specifications
| Specification |
|---|
| Notifications API # dom-notification-actions |