Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

153
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda