Skip to content

Instantly share code, notes, and snippets.

@den-chan
Last active January 9, 2016 03:58
Show Gist options
  • Save den-chan/84fcfdd2412018fea3a3 to your computer and use it in GitHub Desktop.
Save den-chan/84fcfdd2412018fea3a3 to your computer and use it in GitHub Desktop.
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) )
} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment