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.65
edited by bougault
on 2022/03/21 17:30
Change comment: There is no comment for this version
To version 4.63
edited by bougault
on 2022/03/21 17:20
Change comment: There is no comment for this version

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -5,6 +5,8 @@
5 5  });
6 6  
7 7  self.addEventListener("activate" , event => {
8 +// console.log(event);
9 +// clients.claim();
8 8   event.waitUntil(clients.claim());
9 9  });
10 10  
... ... @@ -11,10 +11,11 @@
11 11  self.addEventListener("fetch" , event => {
12 12   const pathname = new URL(event.request.url).pathname;
13 13   if(pathname === '/bin/get/XWiki/LiveTableResults') {
16 + //const res = fetch(event.request).then(res => res.json()).then(json => json["rows"].filter(row => row.doc_viewable === true));
14 14   event.respondWith(fetch(event.request).then(res => res.json()).then(json => {
15 15   const headers = new Headers({'Content-Type': 'application/json'});
16 - const jsonResults = json.rows.filter(row => row.doc_viewable === true);
17 - return new Response(JSON.stringify(jsonResults), {headers});
19 + json["aaaa"] = "aaaa";
20 + return new Response(JSON.stringify(json), {headers});
18 18   }));
19 19   }
20 20  });