Skip to content

Instantly share code, notes, and snippets.

View den-chan's full-sized avatar

den-chan den-chan

View GitHub Profile
@den-chan
den-chan / cache_response.js
Last active January 9, 2016 03:58
Writes to console the file your service worker has cached as "index.html". (Within the limits of String)
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) )
} )