From a7b75782ca580c550eb14970f04e8510e58d91ec Mon Sep 17 00:00:00 2001 From: boxgaming <75969133+boxgaming@users.noreply.github.com> Date: Tue, 13 Aug 2024 09:16:32 -0500 Subject: [PATCH] Updated to dynamically determine whether to use "/" or "/qbjs/" prefix based on origin --- service-worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service-worker.js b/service-worker.js index 9d4a305..3495154 100644 --- a/service-worker.js +++ b/service-worker.js @@ -14,9 +14,9 @@ // Names of the two caches used in this version of the service worker. // Change to v2, etc. when you update any of the local resources, which will // in turn trigger the install event again. -const PRECACHE = 'precache-v2'; +const PRECACHE = 'precache-v3'; const RUNTIME = 'runtime'; -const PREFIX = "/qbjs/"; // "/"; +const PREFIX = (self.location.origin.indexOf("github.io") == -1) ? "/" : "/qbjs/"; // A list of local resources we always want to be cached. const PRECACHE_URLS = [