Available in Chrome 40+
This sample provides some insight into the events involved in a typical service worker registration.
service-worker.js is registered to handle the URL scope
It is "safe" to register the same script multiple times, so it's not necessary to check for a
Various pieces of information about the service worker from the perspective of the registering page
can be found below.
chrome://inspect/#service-workers and click on the "inspect" link below
the registered service worker to view logging statements for the various actions the
service-worker.js script is performing.
Service Workers available in your browser.
'serviceWorker' in navigator.)
This page currently controlled.
navigator.serviceWorker.controller is set.)
navigator.serviceWorker.register() call .
The current registration represents the service worker.
Tip: With a newly registered service worker in the
refresh the page to have the service worker take control.
You can also refresh with the Shift key held down to load
the page without the service worker controlling it.
State transitions of the service worker associated with the current registration: