if('serviceWorker' in navigator) {
  navigator.serviceWorker.register('/sw.js').then(function(registration) {
    // Registration was successful
  }).catch(function(err) {
    // registration failed :(
    console.log('ServiceWorker registration failed: ', err);
  });
}

@@ -1,10 +1,11 @@
 if
+ 
 ('servic
@@ -29,16 +29,65 @@
 ator) %7B%0A
+  window.addEventListener('load', function() %7B%0A  
   naviga
@@ -157,16 +157,18 @@
 ) %7B%0A    
+  
 // Regis
@@ -196,17 +196,106 @@
 l%0A  
-%7D).catch(
+    console.log('ServiceWorker registration successful with scope: ', registration.scope);%0A    %7D, 
 func
@@ -302,24 +302,26 @@
 tion(err) %7B%0A
+  
     // regis
@@ -338,16 +338,18 @@
 iled :(%0A
+  
     cons
@@ -401,16 +401,42 @@
 , err);%0A
+      register();%0A    %7D);%0A
   %7D);%0A%7D%0A

Update web-application.js