Failed to execute template. Cause: [Access denied when checking [script] access to [xwiki:Collaboratory.UX.HbpSkin.WebHome] for user [xwiki:XWiki.Admin]]. Click on this message for details.

LiveTableServiceWorker - HBP Wiki

IAM21 instance, do not create collab nor modify a team, your changes will be lost


Changes for page LiveTableServiceWorker

Last modified by bougault on 2022/03/22 17:19

From version 2.4
edited by bougault
on 2022/03/21 10:41
Change comment: There is no comment for this version
To version 2.5
edited by bougault
on 2022/03/21 10:57
Change comment: There is no comment for this version

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,17 +1,15 @@
1 -console.log('hello sw');
2 -self.addEventListener('fetch', function(event) {
3 - console.log('Handling fetch event for', event.request.url);
4 -/*
5 - event.respondWith(
6 - fetch(event.request).then(function(response) {
7 - if (response.status === 404) {
8 - return fetch("/path/to/404error.gif");
9 - }
10 - return response;
11 - }).catch(function() {
12 - return new Response("Uh oh, that totally failed!");
13 - })
14 - );
15 -*/
1 +self.addEventListener("install" , evt => {
2 + evt.waitUntil(caches.open("main_cache").then(cache => cache.addAll(["/", "/something"])));
3 +
4 + self.skipWaiting();
16 16  });
17 17  
7 +self.addEventListener("activate" , evt => {
8 + console.log(evt);
9 + clients.claim();
10 +});
11 +
12 +self.addEventListener("fetch" , evt => {
13 + console.log(evt);
14 +});
15 +