Commit 524df68b authored by Cerdic's avatar Cerdic

Sur les bons conseils de fil on provisionne une URL d'autodestruction

parent 9979409f
......@@ -26,17 +26,19 @@ self.addEventListener('fetch', function (event){
var strategy = offline.manager(event.request);
// Debug cheese
/*
if (/\/cheese\//.test(event.request.url)){
/**
* Securite pour pouvoir detruire ce service worker dans le futur
*/
if (event.request.url.indexOf('?service-worker-auto-destruction') !== -1) {
self.registration.unregister();
console.log("offline: serviceWorker unregistered");
event.respondWith(
new Response("Flagrant cheese error", {
new Response("Service worker unregistered - bye", {
status: 512
})
);
return;
}
*/
switch (strategy) {
case offline._NETWORK_ONLY:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment