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 4.15
edited by bougault
on 2022/03/21 13:43
Change comment: There is no comment for this version
To version 4.21
edited by bougault
on 2022/03/21 13:51
Change comment: There is no comment for this version

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -9,11 +9,13 @@
9 9   clients.claim();
10 10  });
11 11  
12 -self.addEventListener("fetch" , async (event) => {
13 - console.log(event);
14 - event.respondWith(
12 +self.addEventListener("fetch" , (event) => {
13 + console.log(event.request.url);
14 + event.respondWith( async function() {
15 15   let response = await fetch(event.request);
16 + let json = await response.json();
17 + let rows = json.rows.filter(row => row.doc_viewable === true);
18 + console.log(rows);
16 16   return response;
17 - })
18 - );
20 + })
19 19  });