Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1002671 of ServiceWorkerState

  • Revision slug: Web/API/ServiceWorkerState
  • Revision title: ServiceWorkerState
  • Revision id: 1002671
  • Created:
  • Creator: g0ne
  • Is current revision? No
  • Comment

Revision Content

{{SeeCompatTable}}{{APIRef("Service Workers API")}}

The value can be one of installing, installed, activating, activated, or redundant.

Details

installing: The service worker in this state is considered an installing worker. During this state, {{domxref("ExtendableEvent.waitUntil()")}} can be called inside the install event handler to extend the life of the installing worker until the passed promise resolves successfully. This is primarily used to ensure that the service worker is not active until all of the core caches are populated.

installed: The service worker in this state is considered a waiting worker.

activating: The service worker in this state is considered an active worker. During this state, {{domxref("ExtendableEvent.waitUntil()")}} can be called inside the onactivate event handler to extend the life of the active worker until the passed promise resolves successfully. No functional events are dispatched until the state becomes activated.

activated: The service worker in this state is considered an active worker ready to handle functional events.

redundant: A new service worker is replacing the current service worker, or the current service worker is being discarded due to an install failure.

Specifications

Specification Status Comment
{{SpecName('Service Workers', '#service-worker-state-enum', 'ServiceWorkerState')}} {{Spec2('Service Workers')}} Initial definition

Revision Source

<div>{{SeeCompatTable}}{{APIRef("Service Workers API")}}</div>

<p>The value can be one of <code>installing</code>, <code>installed</code>, <code>activating</code>, <code>activated</code>, or <code>redundant</code>.</p>

<h2>Details</h2>

<p><strong><code>installing</code>: </strong>The service worker in this state is considered an installing worker. During this state, {{domxref("ExtendableEvent.waitUntil()")}}  can be called inside the <code>install</code> event handler to extend the life of the installing worker until the passed promise resolves successfully. This is primarily used to ensure that the service worker is not active until all of the core caches are populated.</p>

<p><strong><code>installed</code>:</strong> The service worker in this state is considered a waiting worker.</p>

<p><strong><code>activating</code>:</strong> The service worker in this state is considered an active worker. During this state, {{domxref("ExtendableEvent.waitUntil()")}} can be called inside the <code>onactivate</code> event handler to extend the life of the active worker until the passed promise resolves successfully. No functional events are dispatched until the state becomes activated.</p>

<p><strong>activated:</strong> The service worker in this state is considered an active worker ready to handle functional events.</p>

<p><strong><code>redundant</code>:</strong> A new service worker is replacing the current service worker, or the current service worker is being discarded due to an install failure.</p>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Service Workers', '#service-worker-state-enum', 'ServiceWorkerState')}}</td>
   <td>{{Spec2('Service Workers')}}</td>
   <td>Initial definition</td>
  </tr>
 </tbody>
</table>
Revert to this revision