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.50
edited by bougault
on 2022/03/21 17:02
Change comment: There is no comment for this version
To version 4.52
edited by bougault
on 2022/03/21 17:07
Change comment: There is no comment for this version

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -10,15 +10,10 @@
10 10  // event.waitUntil(clients.claim());
11 11  });
12 12  
13 -self.addEventListener("fetch" , async (event) => {
14 -
13 +self.addEventListener("fetch" , event => {
15 15   const pathname = new URL(event.request.url).pathname;
16 16   console.log(pathname);
17 17   if(pathname === '/bin/get/XWiki/LiveTableResults') {
18 - const res = await fetch(event.request);
19 - const json = res.json();
20 -
21 - json['hello'] = 'Hello';
22 - event.respondWith(json);
17 + event.respondWith(fetch(event.request).then(res => res.json()).then(json => json["rows"].filter(row => row.doc_viewable === true)));
23 23   }
24 24  });