From 9349b6616d991aff7396083d6048a04642abee2e Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Fri, 2 Dec 2016 12:22:21 +0000 Subject: [PATCH] Reject if there's no active service worker This matches current implementations https://github.com/w3c/ServiceWorker/issues/920#issuecomment-261989472 --- index.html | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index 6f63d61..06b692b 100644 --- a/index.html +++ b/index.html @@ -609,24 +609,9 @@

  • Let registration be the PushManager's associated service worker registration.
  • -
  • If registration has no active worker, run the following substeps: -
      -
    1. If registration has no installing worker and no waiting - worker, reject promise with a DOMException whose - name is "InvalidStateError" and terminate these steps. -
    2. -
    3. Wait for the installing worker or waiting worker of - registration to become its active worker. -
    4. -
    5. If registration fails to activate either worker, reject - promise with a DOMException whose name is - "InvalidStateError" and terminate these steps. -
    6. -
    7. Once registration has an active worker, proceed with the steps - below. -
    8. -
    -
  • +
  • If registration's active worker is null, reject promise + with a DOMException whose name is + "InvalidStateError" and terminate these steps.
  • Ask the user whether they allow the webapp to receive push messages, unless a prearranged trust relationship applies or the user has already granted or denied permission explicitly for this webapp.