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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?