Skip to content

Instantly share code, notes, and snippets.

View luke-denton-aligent's full-sized avatar
⌨️
Writing code for humans

Luke Denton luke-denton-aligent

⌨️
Writing code for humans
  • Aligent Consulting
  • Adelaide, Australia
View GitHub Profile
// 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
});