From 05bb29534963150a8e0e2828a42e8d41e12b74a1 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Mon, 9 Dec 2024 00:28:19 +0800 Subject: [PATCH] fix: remove service worker --- public/sw.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 public/sw.js diff --git a/public/sw.js b/public/sw.js new file mode 100644 index 0000000..f1d50df --- /dev/null +++ b/public/sw.js @@ -0,0 +1,18 @@ +/** + * 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)); + }); +});