Blink‎ > ‎

ServiceWorker

For Web Developers

What is Service Worker?


Getting Started

  1. Install Chrome Canary (Linux users can build Chromium, Android users can build ChromeShell.)
  2. Open the browser and enable the Experimental Web Platform Features flag by cutting and pasting this URL: chrome://flags/#enable-experimental-web-platform-features . Enable the Experimental Web Platform Features option, then restart the browser.
  3. Download service-worker-demo.zip found at the bottom of this page and extract it.
  4. Start a local server in that folder. This is hard if you have never done it before. Ask a buddy or search! 
    • Dominic recommends twistd -n web --path . --port 8080 on Linux
    • Kenji recommends python -m SimpleHTTPServer 8080 on Windows/Mac
  5. Open http://localhost:8080/index.html (or whatever path and port you set up.) Open the Inspector. Things are logged there later on.
  6. Try visiting Cleveland and get a 404. Go back.
  7. Click the 'Register' button, watch the Inspector console, then try visiting Cleveland again... oooh.
  8. Go to chrome://inspect#service-workers and click on Inspect to open the Inspector and debug a Service Worker. There are also some rudimentary debugging tools in chrome://serviceworker-internals .
If you are stuck you might find a quick answer on our Web Developer FAQ page.

W3C Web & Mobile Interest Group maintains a set of Service Worker demos you can experiment with. The implementation in Chrome may not be complete enough to run any of these yet. Contributing to these is a great way for web developers to contribute to the Service Worker effort.

File Bugs

Go to http://crbug.com/new and include "Service Worker" in the summary. You should get a response from an engineer in about one week.

If the browser crashed while you were doing Service Worker development, go to chrome://crashes and cut and paste the Crash ID into the bug report. This kind of bug report is very valuable to us. (If you do not see crashes in chrome://crashes it may be because you chose not to send usage statistics and crash reports to Google. You can change this option in chrome://settings .)

Send feedback

Feedback from hands-on experience is highly appreciated. Here are the different venues you might want to consider:

Track Status

Is Service Worker Ready? tracks the implementation status of Service Worker at a fine-grained, feature-by-feature level in many popular browsers.

For Chromium & Blink Contributors

...interested web developers are welcome to poke around too!

Links

Č
ċ
Dominic Cooney,
Jul 2, 2014, 10:54 PM
Comments