mercredi 9 mai 2018

How to keep Notification click event after refresh the page in web?

var a = new Notification(123, {
  requireInteraction: true,
  renotify: true,
  tag: 123,
})

a.onclick = function () {
  console.log(123)
}

The above code will create a notification and keep the notification does not disappear.When I click on the notification will log 123, but after refresh the page I lost the click event




Aucun commentaire:

Enregistrer un commentaire