Skip to content

Instantly share code, notes, and snippets.

@brittanydionigi
Created March 17, 2015 22:29
Show Gist options
  • Save brittanydionigi/5714020631f235862796 to your computer and use it in GitHub Desktop.
Save brittanydionigi/5714020631f235862796 to your computer and use it in GitHub Desktop.
register-sw
// 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