In this project, we hope to build a set of reference applications that make full use of service workers. Currently there are no working demos in this repo. For ServiceWorker demos try out:
- Simple ServiceWorker Registration demo
- Cleveland respondWith demo
- Wiki engine demo
- isserviceworkerready spec tests
Sorry about going all caps there, but these are all in the earliest stage of development. We are looking for people to help us create these apps!
Our goal is to show how you can perform tasks that are common in native applications using this new set of APIs. We want to keep the apps simple, so they can be easily bisected and copied by anyone.
Please note that the spec and implementations are in a very early stage! You may find issues with implementations in that they may often change or produce strange results at first. :
To see what actually works in browsers today, see Jake Archibald's IsServiceWorkerReady page.
The process below is a guideline to how to get started.
- Fork this repo!
- Choose one of the apps from the directories above.
- Use the app's behavior draft to implement the application.
- Keep it really simple! See our list of resources below to learn about service workers.
We will be hosting them on a website soon, so you can see them as we build them.
Right now, you will need:
- Chrome Canary. Type: "chrome://flags/" in the URL bar and turn on "enable-service-worker" and "experimental-web-platform-features".
If you have a more interesting app you want to build, please add them to this repo. Just add a directory to the root directory with a README.md file explaining what the app does and send us a pull request!
##Resources
- ServiceWorkers and Firefox - Introduction to ServiceWorkers on Firefox!
- Service Worker - first draft published - Introduction and tutorial including code snippets!
- Video: The ServiceWorker: The network layer is yours to own - video introducing ServiceWorker including HTTP caching, request, and showing SW in forms, the basis for push messaging, alarms, geofencing and background sync.
- ServiceWorkerInternals (chrome canary only - chrome://serviceworker-internals/) - page for debugging ServiceWorkers in chrome, including stopping, unregistering and starting workers.
- Jake Archibald's Trained to Thrill - Jake made a great demo app which pulls in images from Flickr, uses fetch, uses cache (not implemented yet) and worker registrations.
- Simple ServiceWorker - A simple Service Worker example by Matt Andrews.
- Promises HTML5Rocks - Understanding Promises (used frequently in ServiceWorkers especially in fetch, cache).
- The Basics of Web Workers - Understanding concurrency in JavaScript and how web workers work.