| <!DOCTYPE html> |
| <html> |
| <title>Service Workers: state</title> |
| <head> |
| <link rel="help" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-state"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| |
| </head> |
| <body> |
| |
| <!-- |
| |
| The [ServiceWorker][1] object can be in several states. The `state` attribute |
| must return the current state, which must be one of the following values |
| defined in the [ServiceWorkerState][2] enumeration: |
| |
| `"installing"`: |
| The Service Worker represented by the [ServiceWorker][1] object has entered |
| and is running the steps in the [installation process][3]. During this |
| state, `e.waitUntil(p)` can be called inside the `oninstall` event handler |
| of the associcated [ServiceWorkerGloberScope][4] object to extend the life |
| of the [installing worker][5] until the passed [Promise][6] 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 represented by the [ServiceWorker][1] object has |
| completed the steps in the [installation process][3]. The Service Worker in |
| this state is considered the [worker in waiting][7]. |
| `"activating"`: |
| The Service Worker represented by the [ServiceWorker][1] object has entered |
| and is running the steps in the [activation process][8]. During this state, |
| `e.waitUntil(p)` can be called inside the `onactivate` event handler of the |
| associated [ServiceWorkerGloberScope][9] object to extend the life of the |
| activating [active worker][10] until the passed [Promise][6] resolves |
| successfully. Note that no [functional events][11] are dispatched until the |
| state becomes `"activated"`. |
| `"activated"`: |
| The Service Worker represented by the [ServiceWorker][1] object has |
| completed the steps in the [activation process][8]. The Service Worker in |
| this state is considered the [active worker][10] ready to [control][12] the |
| documents in matching scope upon subsequence [navigation][13]. |
| `"redundant"`: |
| A newly created Service Worker [registration][14] is replacing the current |
| [registration][14] of the Service Worker. |
| |
| |
| |
| [1]: #service-worker-interface |
| [2]: #service-worker-state-enum |
| [3]: #installation-process |
| [4]: #service-worker-glober-scope-interface |
| [5]: #installing-worker |
| [6]: http://goo.gl/3TobQS |
| [7]: #worker-in-waiting |
| [8]: #activation-process |
| [9]: #service-worker-global-scope-interface |
| [10]: #active-worker |
| [11]: #functional-events |
| [12]: #document-control |
| [13]: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#navigate |
| [14]: #registration |
| |
| --> |
| |
| |
| |
| <script> |
| test(function() { |
| // not_implemented(); |
| }, "There are no tests for section state so far."); |
| </script> |
| |
| </body> |
| </html> |
| |