mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
fix service worker security issue
This commit is contained in:
parent
5615cc7938
commit
2a53c35df7
@ -6,14 +6,18 @@ importScripts(
|
||||
|
||||
const CACHE = "crafty-controller";
|
||||
|
||||
//This service worker is basically just here to make browsers
|
||||
//accept the PWA. It's not doing much anymore
|
||||
|
||||
// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
|
||||
const offlineFallbackPage = "/offline";
|
||||
|
||||
self.addEventListener("message", (event) => {
|
||||
if (event.data && event.data.type === "SKIP_WAITING") {
|
||||
self.skipWaiting();
|
||||
}
|
||||
});
|
||||
// self.addEventListener("message", (event) => {
|
||||
// console.log(event.data);
|
||||
// if (event.data && event.data.type === "SKIP_WAITING") {
|
||||
// self.skipWaiting();
|
||||
// }
|
||||
// });
|
||||
|
||||
if (workbox.navigationPreload.isSupported()) {
|
||||
workbox.navigationPreload.enable();
|
||||
|
Loading…
Reference in New Issue
Block a user