Created
October 17, 2017 14:54
-
-
Save wanderview/1c525a2a6a5b96f61357583933762627 to your computer and use it in GitHub Desktop.
SRI debugging service worker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.skipWaiting(); | |
addEventListener('fetch', evt => { | |
evt.respondWith(async function() { | |
try { | |
let response = await fetch(evt.request); | |
console.log(`==> SUCCESS for url:${evt.request.url} integity:${evt.request.integrity}`); | |
return response; | |
} catch(e) { | |
console.log(`==> FAILURE for url:${evt.request.url} integity:${evt.request.integrity}`); | |
} | |
}()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment