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:
parent
8fef5d8c7b
commit
a7b75782ca
1 changed files with 2 additions and 2 deletions
|
@ -14,9 +14,9 @@
|
||||||
// Names of the two caches used in this version of the service worker.
|
// 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
|
// Change to v2, etc. when you update any of the local resources, which will
|
||||||
// in turn trigger the install event again.
|
// in turn trigger the install event again.
|
||||||
const PRECACHE = 'precache-v2';
|
const PRECACHE = 'precache-v3';
|
||||||
const RUNTIME = 'runtime';
|
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.
|
// A list of local resources we always want to be cached.
|
||||||
const PRECACHE_URLS = [
|
const PRECACHE_URLS = [
|
||||||
|
|
Loading…
Reference in a new issue