Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

140
Vistas
Isn't the JavaScript Notificaiton API useless at this point?

So I read on MDN that the Notification API can only be used on an event initiated by the user. Doesn't this take away any need for this API at all? I can't think of any situation whatsoever where posting a Notification would ever be useful within a user event.

User hits a button: "Hey user, you hit a button! I'm telling you something you already know in the most obnoxious way possible! Hee hee. ^_^"

Are they just deprecating this, or is there still some functionality to it? Am I missing something?

I want to use it to actually notify the user that a note-worthy change has occurred in the state of the application. This is apparently now not a supported use case. Huzzah!

Update:

https://developer.mozilla.org/en-US/docs/Web/API/notification

Quote: "Note: In the above example we spawn notifications in response to a user gesture (clicking a button). This is not only best practice — you should not be spamming users with notifications they didn't agree to — but going forward browsers will explicitly disallow notifications not triggered in response to a user gesture. Firefox is already doing this from version 72, for example."

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You've misread MDN.

https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API

Because of abuses of push notifications in the past, web browsers and developers have begun to implement strategies to help mitigate this problem. You should only request consent to display notifications in response to a user gesture (e.g. clicking a button). This is not only best practice — you should not be spamming users with notifications they didn't agree to — but going forward browsers will explicitly disallow notification permission requests not triggered in response to a user gesture. Firefox is already doing this from version 72, for example, and Safari has done it for some time.

This only affects the initial prompt to allow notifications.

A screenshot of the notifications prompt

Subsequent uses of the Notifications API (once the user selects 'allow') don't require user interactions.

about 4 years ago · Juan Pablo Isaza Denunciar

0

There is a use such as you can make it say stuff you don't know, for example if you forgot your first passkey then you type in your second passkey to see your first passkey, or you can make it say something secret with it in some secretive game such as a ARG.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda