Patricio Vargas
Patricio Vargas

Reputation: 5522

Ask for permissions again after they have been denied in browser

I'm trying to ask the user for permission again after he has denied permissions the first time. So if he click on my button enable notifications, after he has denied them the first time the browser should ask him again. According to this answer:

Notification popup doesn't appear in chrome

It's not possible, but I don't know if this has changed since 2014.

if (window.Notification || Notification.permission === 'denied') {
   Notification.requestPermission(status => {
   // do something
   });
}

Upvotes: 3

Views: 5190

Answers (1)

scibuff
scibuff

Reputation: 13755

When Notification.permission value is denied it is by design that the Notification.requestPermission pop-up does NOT show up. The pop-up shows up only when the permission value is default. If the value is denied, it needs to be reset in browser's settings, e.g. chrome://settings/content/notifications

Upvotes: 2

Related Questions