nonebot2/website/static/service-worker.js
2023-09-27 16:00:26 +08:00

15 lines
336 B
JavaScript

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