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.66
edited by bougault
on 2022/03/21 17:37
Change comment: There is no comment for this version
To version 2.2
edited by bougault
on 2022/03/21 10:24
Change comment: There is no comment for this version

Summary

Details

Page properties
Parent
... ... @@ -1,1 +1,0 @@
1 -Main.WebHome
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,20 +1,17 @@
1 -$response.addHeader('Service-Worker-Allowed', '/bin/view/Membership')
2 -$response.setContentType("text/javascript")
3 -self.addEventListener("install" , event => {
4 - self.skipWaiting();
1 +console.log('hello sw');
2 +self.addEventListener('fetch', function(event) {
3 +console.log('sw', event);
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 +*/
5 5  });
6 6  
7 -self.addEventListener("activate" , event => {
8 - event.waitUntil(clients.claim());
9 -});
10 -
11 -self.addEventListener("fetch" , event => {
12 - const pathname = new URL(event.request.url).pathname;
13 - if(pathname === '/bin/get/XWiki/LiveTableResults') {
14 - event.respondWith(fetch(event.request).then(res => res.json()).then(json => {
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});
18 - }));
19 - }
20 -});
Parse content
... ... @@ -1,1 +1,0 @@
1 -Yes
Use this extension
... ... @@ -1,1 +1,0 @@
1 -onDemand