Skip to content

Instantly share code, notes, and snippets.

@luke-denton-aligent
Last active January 14, 2018 19:00
Show Gist options
  • Save luke-denton-aligent/d1ab998ddd877f26376776ec433b0a13 to your computer and use it in GitHub Desktop.
Save luke-denton-aligent/d1ab998ddd877f26376776ec433b0a13 to your computer and use it in GitHub Desktop.
// Offline Web Applications course on Udacity https://classroom.udacity.com/courses/ud899
if (!navigator.serviceWorker) return; //Feature detection
navigator.serviceWorker.register("/sw.js").then(function() { //Include the service worker js file
//Registration worked
}).catch(function() {
//Registration didn't work
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment