a guest Dec 14th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if ('serviceWorker' in navigator) {
  2.   navigator.serviceWorker.register('./sw.js', { scope: './' })
  3.   console.log('Service worker installing');
  4. } else if (reg.waiting) {
  5.   console.log('Service worker installed');
  6.   console.log('Service worker active');
  7. }).catch((error) => console.log('Registration failed with ' + error));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand