Skip to content

Commit

Permalink
Merge pull request #7 from noahlam/patch-1
Browse files Browse the repository at this point in the history
docs: fix typo in service-worker.md
  • Loading branch information
ruanyf authored Sep 29, 2022
2 parents b3fe8e8 + f39deeb commit db7c478
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/service-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ navigator.serviceWorker.register('sw.js'.then(() => {
})
```
上面代码的`sw.js`就是需要浏览器注册的 service worker 脚本。注意,这个脚本必须与当前网址同域,service worker 不支持跨与脚本。另外,`sw.js`必须是从 HTTPS 协议加载的。
上面代码的`sw.js`就是需要浏览器注册的 service worker 脚本。注意,这个脚本必须与当前网址同域,service worker 不支持跨域脚本。另外,`sw.js`必须是从 HTTPS 协议加载的。
默认情况下,Service worker 只对根目录`/`生效,如果要改变生效范围,可以运行下面的代码。
Expand Down

0 comments on commit db7c478

Please sign in to comment.