Closed Bug 1012167 Opened 10 years ago Closed 8 years ago

[Web Notifications] Notification.requestPermission(callback) not invoke callback when permission is "default"

Categories

(Core :: DOM: Core & HTML, defect)

32 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1241749

People

(Reporter: crimsteam, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release)
Build ID: 20140506152807

Steps to reproduce:

When we make Notifications.requestPermission(callback) and permission is "default", then closing popup (by click on the "x") should still invoke callback. Now (for this case) callback is never inkove.

<script>

    Notification.requestPermission(function(permit){
        alert(permit);
    });

</script>

Per spec (http://notifications.spec.whatwg.org/#dom-notification-requestpermission) this behaviour in Firefox is not correct, or spec not clearly define step, when we close popup (but still don't change "default").

Chrome doesn't have this problem.
Flags: needinfo?(wchen)
Summary: [Web Notifications] Notifications.requestPermission(callback) not invoke callback when permission is "default" → [Web Notifications] Notification.requestPermission(callback) not invoke callback when permission is "default"
The callback is also not called when I choose 'Not now' (Firefox 42.0 for Ubuntu).

The functionality is described here also: https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission

There "default" is given as a possible resulting permission. That implies that there should be a way not to change the setting. As the other two options set "granted" or "denied", currently the only ways of 'choosing' "default" is:
 - closing the dialog
 - choosing "Not now"

So at least "Not now", but preferably also closing the dialog should call the callback with "default".
AFAIK, this affects all permission doorhangers in Firefox, not just notifications (see bug 675533 for the same discussion around geolocation prompts).

If you dismiss the dialog by clicking the "x," you can summon the doorhanger later by clicking the permission icon in the URL bar. In practice, I'm not sure how many folks do that, or are even aware of it.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I think we'll use bug 1241749 to track this.
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(wchen)
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.