This commit is contained in:
Vanessa 2023-04-19 18:56:48 +08:00
parent 26e77a3529
commit 7e0716eafc

View file

@ -1,7 +1,7 @@
// https://github.com/siyuan-note/siyuan/pull/8012 // https://github.com/siyuan-note/siyuan/pull/8012
export const registerServiceWorker = (scriptURL: string) => { export const registerServiceWorker = (scriptURL: string) => {
if (!"serviceWorker" in navigator || typeof (navigator.serviceWorker) === "undefined" || if (!("serviceWorker" in navigator) || typeof (navigator.serviceWorker) === "undefined" ||
!"caches" in window || !"fetch" in window) { !("caches" in window) || !("fetch" in window)) {
return; return;
} }
// REF https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration // REF https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration