sw-test

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

  • 所有者: mdn/sw-test
  • 平台:
  • 许可证: Creative Commons Zero v1.0 Universal
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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.

主要指标

概览
名称与所有者mdn/sw-test
主编程语言JavaScript
编程语言JavaScript (语言数: 3)
平台
许可证Creative Commons Zero v1.0 Universal
所有者活动
创建于2014-07-10 14:11:25
推送于2022-08-13 12:13:24
最后一次提交2017-05-02 10:23:58
发布数0
用户参与
星数753
关注者数32
派生数253
提交数166
已启用问题?
问题数21
打开的问题数0
拉请求数19
打开的拉请求数0
关闭的拉请求数4
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?