Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Difference between new Notification() and ServiceWorkerRegistration.showNotification()

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!