Closed
Bug 1267850
Opened 9 years ago
Closed 9 years ago
requestPermission promise-based syntax doesn't work when the user selects Not Now
Categories
(Toolkit Graveyard :: Notifications and Alerts, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1259148
People
(Reporter: xavier.figueroa, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
Build ID: 20160425004018
Steps to reproduce:
<button onclick="enableNotifications()">Enable</button>
function enableNotifications() {
if (!("Notification" in window)) {
console.log("This browser does not support desktop notification");
}else if (Notification.permission === 'denied'){
alert("Previously Denied. review your browser settings");
}else if (Notification.permission === 'default'){
Notification.requestPermission().then(function(result) {
if (result === 'denied') {
alert("Denied. review your browser settings");
return;
}
if (result === 'default') {
alert('The permission request was dismissed.');//chrome only
return;
}
if (result === 'granted') {
alert('Successfully enabled.');
return;
}
});
}else {
alert("already enabled");
}
}
1-fire the function enableNotifications() by clicking the enable button
2-Click Not Now or Close de dialog "Would you like to receive notifications from this site?"
Actual results:
no alert showed (it works in chrome)
Expected results:
alert showing the message "The permission request was dismissed."
Comment 1•9 years ago
|
||
Thanks for the report! This should be fixed in Nightly (49) and will make its way to Aurora (48) soon. I'll also request uplift to Beta (47) later this week.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Updated•2 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•