Created
March 17, 2015 22:29
-
-
Save brittanydionigi/5714020631f235862796 to your computer and use it in GitHub Desktop.
register-sw
This file contains hidden or 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
// Check for Service Workers and register service worker script | |
function registerServiceWorker(workerFile) { | |
console.log("Checking for service workers..."); | |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register(workerFile, { | |
scope: './' | |
}).then(function(reg) { | |
console.log("Service Worker Successfully Registered"); | |
enableSubmitButton(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment