Blink‎ > ‎ServiceWorker‎ > ‎

Service Worker FAQ

Q: How do I tell if it is "working"?

A: If you expect a ServiceWorker to be running, chrome://inspect/#service-workers ; otherwise chrome://serviceworker-internals to see the registrations. If there are none, they will be empty.

Q: It's not working!

A:  In the Inspector, see if navigator.serviceWorker is defined. If not:

First, check that you are using at least Chrome 38. On Windows and OS X use Chrome Dev Channel or Chrome Canary. On Linux, you can build Chromium or use Chrome Dev Channel. On Android, you can build Chrome Shell. Service Workers are not supported by Chrome on iOS.

Next, open chrome://flags/#enable-experimental-web-platform-features and check that Experimental Web Platform Features is enabled.

Q: How do I debug?

A: chrome://inspect/#service-workers . If you need to debug the event listener wire-up use chrome://serviceworker-internals .

Q: When I have Developer Tools open, requests go straight to the network; the Service Worker does not get a fetch event.

A: On the Developer Tools' Network tab, if Disable cache is checked, requests will go to the network instead of the Service Worker. Uncheck that.

Q: I get an error message about "Only secure origins are allowed"

A: Service Workers are only available to "secure origins" (HTTPS sites, basically) in line with a policy to prefer secure origins for powerful new features. However http://localhost is also considered a secure origin, so if you can, developing on localhost is an easy way to avoid this error.

Q: What are those buttons on chrome://serviceworker-internals?

A: This page shows your registered workers and provides some basic operations.

Unregister: Unregisters the worker.
Start: Starts the worker. This would happen automatically when you navigate to a page in the worker's scope.
Stop: Stops the worker.
Sync: Dispatches a 'sync' event to the worker. If you don't handle this event, nothing will happen.
Push: Dispatches a 'push' event to the worker. If you don't handle this event, nothing will happen.
Inspect: Opens the worker in the Inspector.

Q: I made a change to my service worker. How do I reload?

A: See the "development flow" section of the getting started page for our recommendation.

Q: The cache API doesn't match the spec.

A: Currently, it's just an interim polyfill. Feel free to star the native cache API bug to get updates on our progress toward the real thing.

Q: I have a different question.

A: Leave a comment here or reach us out via blink-dev with Service Worker in the subject of your email.