sw-test

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

  • Owner: mdn/sw-test
  • Platform:
  • License:: Creative Commons Zero v1.0 Universal
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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.

Main metrics

Overview
Name With Ownermdn/sw-test
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 3)
Platform
License:Creative Commons Zero v1.0 Universal
所有者活动
Created At2014-07-10 14:11:25
Pushed At2022-08-13 12:13:24
Last Commit At2017-05-02 10:23:58
Release Count0
用户参与
Stargazers Count753
Watchers Count32
Fork Count253
Commits Count166
Has Issues Enabled
Issues Count21
Issue Open Count0
Pull Requests Count19
Pull Requests Open Count0
Pull Requests Close Count4
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private