nonebot2/website/static/service-worker.js
StarHeart 14b145b58d
📝 Docs: 修复旧 Vuepress 文档缓存问题 ()
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-02 10:19:51 +08:00

15 lines
338 B
JavaScript

self.addEventListener("install", function (e) {
self.skipWaiting();
});
self.addEventListener("activate", function (e) {
self.registration
.unregister()
.then(function () {
return self.clients.matchAll();
})
.then(function (clients) {
clients.forEach((client) => client.navigate(client.url));
});
});