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");
}
});NotificationEvent: action property / notebook
NotificationEvent: action property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.