Skip to content

Commit

Permalink
Reject if there's no active service worker
Browse files Browse the repository at this point in the history
This matches current implementations w3c/ServiceWorker#920 (comment)
  • Loading branch information
jakearchibald committed Dec 2, 2016
1 parent b94894e commit 9349b66
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -609,24 +609,9 @@ <h2>
<li>Let <var>registration</var> be the <code><a>PushManager</a></code>'s associated
<a>service worker registration</a>.
</li>
<li>If <var>registration</var> has no <a>active worker</a>, run the following substeps:
<ol>
<li>If <var>registration</var> has no <a>installing worker</a> and no <a>waiting
worker</a>, reject <var>promise</var> with a <code><a>DOMException</a></code> whose
name is "<code><a>InvalidStateError</a></code>" and terminate these steps.
</li>
<li>Wait for the <a>installing worker</a> or <a>waiting worker</a> of
<var>registration</var> to become its <a>active worker</a>.
</li>
<li>If <var>registration</var> fails to activate either worker, reject
<var>promise</var> with a <code><a>DOMException</a></code> whose name is
"<code><a>InvalidStateError</a></code>" and terminate these steps.
</li>
<li>Once <var>registration</var> has an <a>active worker</a>, proceed with the steps
below.
</li>
</ol>
</li>
<li>If <var>registration</var>'s <a>active worker</a> is null, reject <var>promise</var>
with a <code><a>DOMException</a></code> whose name is
"<code><a>InvalidStateError</a></code>" and terminate these steps.</li>
<li>Ask the user whether they allow the <a>webapp</a> to receive <a>push messages</a>,
unless a prearranged trust relationship applies or the user has already granted or denied
permission explicitly for this <a>webapp</a>.
Expand Down

0 comments on commit 9349b66

Please sign in to comment.