Closed
Bug 1206302
Opened 9 years ago
Closed 9 years ago
pushManager.subscribe rejects with string "PermissionDeniedError" instead of DOMException
Categories
(Core :: DOM: Push Subscriptions, defect)
Core
DOM: Push Subscriptions
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: callahad, Assigned: lina)
References
Details
(Keywords: DevAdvocacy)
Attachments
(1 file, 1 obsolete file)
When pushManager.subscribe() fails, the spec states that it should: > reject promise with a DOMException whose name is "PermissionDeniedError" We reject with the literal string "PermissionDeniedError" instead. Spec: https://w3c.github.io/push-api/#idl-def-PushManager Code: https://dxr.mozilla.org/mozilla-central/rev/9ed17db42e3e46f1c712e4dffd62d54e915e0fac/dom/push/Push.js?offset=0#152-154
Reporter | ||
Comment 1•9 years ago
|
||
Steps to Reproduce: 1. Visit a page with a serviceworker, like https://mdn.github.io/sw-test/ 2. In the console, run: var x; navigator.serviceWorker.ready .then(reg => reg.pushManager.subscribe()) .catch(e => { x = e; let example = new DOMException("PermissionDeniedError"); console.log("Subscription failed."); console.log("Type of error is:", typeof e, "(", e ,")"); console.log("Error", e instanceof DOMException ? "is" : "IS NOT", "an instanceof DOMException"); console.log("The error has been assigned to global variable `x` for inspection."); }); 3. In the permissions doorhanger, choose to block notifications.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → kcambridge
Assignee | ||
Comment 2•9 years ago
|
||
WIP patch.
Assignee | ||
Updated•9 years ago
|
Attachment #8663950 -
Attachment is obsolete: true
Assignee | ||
Comment 3•9 years ago
|
||
Bug 1206302 - Use `DOMException` for Push errors. r?mt
Attachment #8682280 -
Flags: review?(martin.thomson)
Assignee | ||
Comment 4•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6a30000d4de1
Comment 5•9 years ago
|
||
Comment on attachment 8682280 [details] MozReview Request: Bug 1206302 - Use `DOMException` for Push errors. r=mt https://reviewboard.mozilla.org/r/24039/#review21631 This looks fine. I'm a little surprised that you don't have any tests for this though.
Attachment #8682280 -
Flags: review?(martin.thomson) → review+
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8682280 [details] MozReview Request: Bug 1206302 - Use `DOMException` for Push errors. r=mt Review request updated; see interdiff: https://reviewboard.mozilla.org/r/24039/diff/1-2/
Attachment #8682280 -
Attachment description: MozReview Request: Bug 1206302 - Use `DOMException` for Push errors. r?mt → MozReview Request: Bug 1206302 - Use `DOMException` for Push errors. r=mt
Assignee | ||
Comment 7•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/73aef6e86bff7efdaeb7e876fe9198ae241838a5 Bug 1206302 - Use `DOMException` for Push errors. r=mt
Comment 8•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/73aef6e86bff
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•