Quellcode durchsuchen

Clean out debugging output for service-worker

Trevor Elliott vor 3 Jahren
Ursprung
Commit
60eed346e3
2 geänderte Dateien mit 2 neuen und 17 gelöschten Zeilen
  1. 2 7
      js/index.js
  2. 0 10
      js/serviceWorker.js

+ 2 - 7
js/index.js

@@ -70,11 +70,6 @@ document.addEventListener("DOMContentLoaded", () => {
 });
 
 if ('serviceWorker' in navigator) {
-  navigator.serviceWorker
-    .register('/service-worker')
-    .then(function(registration) {
-      console.log("ServiceWorker registration successful with scope: ", registration.scope);
-    }).catch(function(err) {
-      console.log("ServiceWorker registration failed: ", err);
-    });
+  // TODO(trevor) does it matter if this fails?
+  navigator.serviceWorker.register('/service-worker')
 }

+ 0 - 10
js/serviceWorker.js

@@ -1,19 +1,9 @@
 
 self.addEventListener("install", event => {
-  console.log("installing...");
 });
 
 self.addEventListener("activate", event => {
-  console.log("activate!");
 });
 
 self.addEventListener("fetch", event => {
-  console.log("start service worker");
-
-  event.respondWith(
-    fetch(event.request).then(response => {
-      console.log("fetching %s", event.request.url);
-      return response;
-    })
-  );
 });