Once you get permission from a user to show a browser notification, there seem to be two ways to do it.
The simple way:
new Notification(title, options);
The complicated way:
navigator.serviceWorker.register(pathToServiceWorkerScript)
.then(function (registration) {
registration.showNotification(title, options);
});
In the simplest case, these seem to do the same thing. But from what I've read, you can't put action buttons in the notification unless you go the complicated service worker route. This entails writing a whole service worker script.
I'd like to be able to show action buttons without a service worker. I'm having a hard time understanding service workers and they seem way too overwrought for my purposes. The only thing they have that I want is custom buttons on a notification. Is there any way to do this without service workers?