How to detect whether notification permission is prompted

39 views
Skip to first unread message

Captain Hunlex

unread,
Jan 26, 2020, 4:46:51 PM1/26/20
to Chromium HTML5

The way of accessing notification permission status is basically from Notification.permission and if it is neither granted nor blocked, it returns default.


Then, let's say you trigger notification permission request via Notification.requestPermission(). It returns a promise and Notification.permission value is still default, nothing changed.


I have Permission API Sample codes, and from navigator object, still you could not decide whether notification permission is prompted or not.


So, how could we detect whether notification permission dialog is triggered or not, before waiting any user interaction with prompt dialog (deny, allow or close)?

Screen Shot 2020-01-26 at 23.21.32.png
Reply all
Reply to author
Forward
0 new messages