You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// disable-devtools.js
...
letchannel=newMessageChannel();letrequestTimestamp=Date.now();channel.port1.addEventListener('message',(event)=>{if(Array.isArray(event.data)&&event.data[0]==='ping'&&event.data[1]===client.id){letrtt=Date.now()-event.data[2];clientsLastResponses.set(client.id,rtt);letrecentRequests=clientsRecentRequests.get(client.id);if(recentRequests){while(recentRequests.length>0&&recentRequests[0]<=event.data[2]){recentRequests.shift();}}}});channel.port1.start();// only the first parameter "ping" is mandatoryclient.postMessage(['ping',client.id,requestTimestamp],[channel.port2]);
...
The entry page side (automatically starts on load)
functionstartPingService(){console.log('service-worker.js: startPingService');navigator.serviceWorker.addEventListener('message',function(event){letport=event.ports[0];letdata=event.data;//console.log('startPingService: received ', JSON.stringify(data));if(port&&Array.isArray(data)&&data[0]==='ping'){//console.log('startPingService: postMessage ', JSON.stringify(data));port.postMessage(data);}});}
The text was updated successfully, but these errors were encountered:
Block direct access to sources (Deprecate #237)
Another approach to block access to sources via browser
hook.min.js
has&service-worker-ready=
parameter)about:blank
hook.parameters.appPathRoot = '/';
location.origin + hook.parameters.appPathRoot
Implementation
hook.parameters.checkRequest = function (event, response) { /* check request */ return response ; }
The text was updated successfully, but these errors were encountered: