Skip to content

Instantly share code, notes, and snippets.

Avatar

den-chan den-chan

View GitHub Profile
@den-chan
den-chan / cache_response.js
Last active Jan 9, 2016
Writes to console the file your service worker has cached as "index.html". (Within the limits of String)
View cache_response.js
caches.match(
new Request( "index.html" )
).then( function (response) {
return response.body.getReader().read()
} ).then( function (stream) {
console.log( String.fromCharCode.apply(null, stream.value) )
} )