Created
December 27, 2016 22:49
-
-
Save d33tah/87edc96c7ff0fab8d9e54965e72e6532 to your computer and use it in GitHub Desktop.
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<script> | |
navigator.serviceWorker.register('/sw.js').catch(e=>console.error('Ups!' + e)) | |
</script> | |
</head> | |
<body> | |
Tutaj nic nie ma. | |
</body> | |
</html> |
This file contains 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.addEventListener('fetch', function(ev) { | |
if (ev.request.url.endsWith('.worker')) { | |
ev.respondWith(new Response('<strong>Ten URL istnieje!</strong>', | |
{headers: | |
{"Content-type":"text/html"} | |
})); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment