mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 01:21:56 +08:00
19 lines
378 B
JavaScript
19 lines
378 B
JavaScript
/**
|
|
* Self-Destroy service worker
|
|
*/
|
|
|
|
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));
|
|
});
|
|
});
|