Open
Bug 1244349
Opened 7 years ago
Updated 1 year ago
Ensure push subscriptions are associated with an active service worker
Categories
(Core :: DOM: Push Notifications, defect, P3)
Core
DOM: Push Notifications
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox47 | --- | affected |
People
(Reporter: lina, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: dom-triaged)
https://w3c.github.io/push-api/#pushmanager-interface says we should wait until the service worker registration has an active worker before creating a subscription, but we don't actually enforce that. It's possible to register a worker, capture its `PushManager`, unregister, and create subscriptions like so: let pushManager; navigator.serviceWorker.register("./sw.js").then(registration => { pushManager = registration.pushManager; return registration.unregister(); }).then(_ => { return pushManager.subscribe(); }).then(subscription => { // Created subscription without active worker. }); We should wait until the worker is active, and, once the registration is removed, `pushManager.subscribe()` should reject with an InvalidStateError.
Updated•7 years ago
|
Whiteboard: dom-triaged
Reporter | ||
Comment 1•6 years ago
|
||
Another issue is that a push subscription can be created by a non-active worker. See https://github.com/w3c/push-api/issues/221.
Updated•4 years ago
|
Priority: -- → P3
Updated•1 year ago
|
Severity: normal → S4
You need to log in
before you can comment on or make changes to this bug.
Description
•