Created
January 23, 2022 11:46
-
-
Save rishi-raj-jain/7776bb41e923166846c71eb667d5f977 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
<script> | |
// Check that service workers are supported | |
if ('serviceWorker' in navigator) { | |
// Use the window load event to keep the page load performant | |
window.addEventListener('load', () => { | |
navigator.serviceWorker.register('/service-worker.js'); | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment