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

134
Views
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 answers
Answer question

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 Report

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 Report
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!