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.85
edited by bougault
on 2022/03/22 16:14
Change comment: There is no comment for this version
To version 4.71
edited by bougault
on 2022/03/22 08:36
Change comment: There is no comment for this version

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,9 +1,7 @@
1 1  $response.addHeader('Service-Worker-Allowed', '/bin/view/Membership')
2 2  $response.setContentType("text/javascript")
3 -const version = "0.1.0";
4 -/*
5 5  self.addEventListener("install" , event => {
6 - //self.skipWaiting();
4 + self.skipWaiting();
7 7  });
8 8  
9 9  self.addEventListener("activate" , event => {
... ... @@ -12,20 +12,14 @@
12 12  
13 13  self.addEventListener("fetch" , event => {
14 14   const pathname = new URL(event.request.url).pathname;
15 - if(pathname === '/bin/get/XWiki/LiveTableResults') {
13 + if(pathname === '/getMembershipRequets') {
14 + return new Response('should return membership requests');
15 + /*
16 16   event.respondWith(fetch(event.request).then(res => res.json()).then(json => {
17 17   const headers = new Headers({'Content-Type': 'application/json'});
18 18   const jsonResults = json.rows.filter(row => row.doc_viewable === true);
19 19   return new Response(JSON.stringify(jsonResults), {headers});
20 20   }));
21 + */
21 21   }
22 22  });
23 -*/
24 -self.addEventListener("fetch", (e) => {
25 - const pathname = new URL(event.request.url).pathname;
26 - console.log("sw", pathname);
27 - if(pathname === "/getMembershipRequests") {
28 - const res = new Response("custom response");
29 - e.respondWith(res);
30 - }
31 -})