forked from XiaoMo/ChatGPT-Next-Web
Merge pull request #3095 from Yidadaa/revert-3013-main
This commit is contained in:
commit
b90dfb48ee
@ -1,21 +1,15 @@
|
|||||||
const CHATGPT_NEXT_WEB_CACHE = "chatgpt-next-web-cache";
|
const CHATGPT_NEXT_WEB_CACHE = "chatgpt-next-web-cache";
|
||||||
|
|
||||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/7.0.0/workbox-sw.js');
|
|
||||||
|
|
||||||
self.addEventListener("activate", function (event) {
|
self.addEventListener("activate", function (event) {
|
||||||
console.log("ServiceWorker activated.");
|
console.log("ServiceWorker activated.");
|
||||||
});
|
});
|
||||||
|
|
||||||
workbox.core.clientsClaim();
|
self.addEventListener("install", function (event) {
|
||||||
self.addEventListener("message", (event) => {
|
event.waitUntil(
|
||||||
if (event.data && event.data.type === "SKIP_WAITING") {
|
caches.open(CHATGPT_NEXT_WEB_CACHE).then(function (cache) {
|
||||||
self.skipWaiting();
|
return cache.addAll([]);
|
||||||
}
|
}),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
workbox.routing.registerRoute(
|
self.addEventListener("fetch", (e) => {});
|
||||||
new RegExp('/*'),
|
|
||||||
new workbox.strategies.StaleWhileRevalidate({
|
|
||||||
cacheName: CHATGPT_NEXT_WEB_CACHE
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user