From 783f271d4c88212b8f5e3abb1d27918c19bb8022 Mon Sep 17 00:00:00 2001 From: zinobias Date: Mon, 17 Apr 2023 12:30:21 +0200 Subject: [PATCH] serviceworker.js: Adjusted a comment in, to clarify the ifstatement in doRegister(). --- serviceWorker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/serviceWorker.js b/serviceWorker.js index f74dbf1..db2c7db 100644 --- a/serviceWorker.js +++ b/serviceWorker.js @@ -61,7 +61,8 @@ async function doRegister() { console.log("Service Worker failed reloading the page. ERROR:" + err); }; }); - // If the registration is active, but it's not controlling the page, reload the page to have it take control + // When the registration is active, but it's not controlling the page, we reload the page to have it take control. + // This f.e occurs when you hard-reload (shift + refresh). https://www.w3.org/TR/service-workers/#navigator-service-worker-controller if (registration.active && !navigator.serviceWorker.controller) { console.log("Reloading the page to transfer control to the Service Worker."); try {