1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-09-19 20:14:58 +00:00

Updated to dynamically determine whether to use "/" or "/qbjs/" prefix based on origin

This commit is contained in:
boxgaming 2024-08-13 09:16:32 -05:00
parent 8fef5d8c7b
commit a7b75782ca

View file

@ -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 = [