mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'bugfix/service-worker' into 'dev'
fix service worker security issue See merge request crafty-controller/crafty-4!631
This commit is contained in:
commit
61927f6c8d
@ -10,6 +10,7 @@
|
||||
- Bump crypto to resolve #267 & #268 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/622))
|
||||
- Fix select installs failing to start, returning missing python package `packaging` ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/629))
|
||||
- Fix public status page not updating #255 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/615))
|
||||
- Fix service worker vulrn and CQ raised by SonarQ ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/631))
|
||||
### Refactor
|
||||
- Consolidate remaining frontend functions into API V2, and remove ajax internal API ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/585))
|
||||
- Replace bleach with nh3 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/628))
|
||||
|
@ -6,36 +6,9 @@ importScripts(
|
||||
|
||||
const CACHE = "crafty-controller";
|
||||
|
||||
// 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();
|
||||
}
|
||||
});
|
||||
//This service worker is basically just here to make browsers
|
||||
//accept the PWA. It's not doing much anymore
|
||||
|
||||
if (workbox.navigationPreload.isSupported()) {
|
||||
workbox.navigationPreload.enable();
|
||||
}
|
||||
|
||||
// self.addEventListener('fetch', (event) => {
|
||||
// if (event.request.mode === 'navigate') {
|
||||
// event.respondWith((async () => {
|
||||
// try {
|
||||
// const preloadResp = await event.preloadResponse;
|
||||
|
||||
// if (preloadResp) {
|
||||
// return preloadResp;
|
||||
// }
|
||||
// const networkResp = await fetch(event.request);
|
||||
// return networkResp;
|
||||
// } catch (error) {
|
||||
|
||||
// const cache = await caches.open(CACHE);
|
||||
// const cachedResp = await cache.match(offlineFallbackPage);
|
||||
// return cachedResp;
|
||||
// }
|
||||
// })());
|
||||
// }
|
||||
// });
|
||||
|
Loading…
Reference in New Issue
Block a user