Skip to content

Instantly share code, notes, and snippets.

@edoardocavazza
Created December 14, 2017 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edoardocavazza/b7051e6f45ad2203cad3c7be2c50df74 to your computer and use it in GitHub Desktop.
Save edoardocavazza/b7051e6f45ad2203cad3c7be2c50df74 to your computer and use it in GitHub Desktop.
// intercept network requests
this.addEventListener('fetch', (event) => {
// check if `event.request` è un file js
if (event.request.url.match(/.js$/)) {
event.respondWith(
// -> handle del file js
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment