Skip to content
forked from mdn/sw-test

Service Worker test repository. This is a very simple demo to show basic service worker features in action.

License

Notifications You must be signed in to change notification settings

everbrez/sw-test

 
 

Repository files navigation

sw-test

Service Worker test repository. This is a very simple demo to show basic service worker features in action. The demo can be seen on our GitHub pages.

You can find a lot more out about how this works by reading Using Service Workers. In particular, read Why is my service worker failing to register? if you are having problems getting your code to do anything. You need to change the paths relative to where you are serving your files from!

Running locally

To get this code. running locally on your computer as-is, you need to do the following:

  1. Clone the repo in a location on your machine.
  2. Start a local server running in the parent directory of the sw-test directory. For example, if you have Python on your machine you could start a server running on port 8001 using python -m SimpleHTTPServer 8001 for Python 2.x, or python3 -m http.server 8001 for Python 3.x.
  3. Navigate to the sw-test directory on the local server, e.g. http://localhost:8001/sw-test/

Note: The example has to be located under the sw-test directory (e.g. http://localhost:8001/sw-test/) and not at the root of the server (e.g. http://localhost:8001/) or anywhere else, for the service worker to work. It expects the document and associated assets it is controlling to be at this location.

About

Service Worker test repository. This is a very simple demo to show basic service worker features in action.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 83.1%
  • CSS 8.6%
  • HTML 8.3%