From 196dce6ed733ffee3f483900e00975b5b5e5d18e Mon Sep 17 00:00:00 2001 From: rexim Date: Thu, 23 Nov 2023 13:27:44 +0700 Subject: [PATCH] Use relative paths for assets and serviceworker --- js/index.js | 2 +- serviceworker.js | 22 +++++++++++----------- serviceworker.ts | 22 +++++++++++----------- ts/index.ts | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/js/index.js b/js/index.js index b9ea9e4..5d46558 100644 --- a/js/index.js +++ b/js/index.js @@ -383,7 +383,7 @@ function FilterSelector() { } window.onload = function () { if ("serviceWorker" in navigator) { - navigator.serviceWorker.register('/serviceworker.js').then(function (registration) { + navigator.serviceWorker.register('serviceworker.js').then(function (registration) { console.log("Registered a Service Worker ", registration); }, function (error) { console.error("Could not register a Service Worker ", error); diff --git a/serviceworker.js b/serviceworker.js index 653cca4..11cafd7 100644 --- a/serviceworker.js +++ b/serviceworker.js @@ -37,17 +37,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; var cacheName = "emoteJAM-v1"; var assets = [ - '/index.html', - '/css/bright.css', - '/css/main.css', - '/css/reset.css', - '/gif.js', - '/gif.worker.js', - '/img/tsodinClown.png', - '/js/eval.js', - '/js/filters.js', - '/js/grecha.js', - '/js/index.js', + 'index.html', + 'css/bright.css', + 'css/main.css', + 'css/reset.css', + 'gif.js', + 'gif.worker.js', + 'img/tsodinClown.png', + 'js/eval.js', + 'js/filters.js', + 'js/grecha.js', + 'js/index.js', ]; self.addEventListener("install", function (e) { console.log("[Service Worker] Install"); diff --git a/serviceworker.ts b/serviceworker.ts index 78164d3..ecc7b8e 100644 --- a/serviceworker.ts +++ b/serviceworker.ts @@ -1,16 +1,16 @@ const cacheName = "emoteJAM-v1"; const assets = [ - '/index.html', - '/css/bright.css', - '/css/main.css', - '/css/reset.css', - '/gif.js', - '/gif.worker.js', - '/img/tsodinClown.png', - '/js/eval.js', - '/js/filters.js', - '/js/grecha.js', - '/js/index.js', + 'index.html', + 'css/bright.css', + 'css/main.css', + 'css/reset.css', + 'gif.js', + 'gif.worker.js', + 'img/tsodinClown.png', + 'js/eval.js', + 'js/filters.js', + 'js/grecha.js', + 'js/index.js', ]; self.addEventListener("install", e => { diff --git a/ts/index.ts b/ts/index.ts index 00db943..f45e7ab 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -513,7 +513,7 @@ function FilterSelector() { window.onload = () => { if ("serviceWorker" in navigator) { - navigator.serviceWorker.register('/serviceworker.js').then( + navigator.serviceWorker.register('serviceworker.js').then( (registration) => { console.log("Registered a Service Worker ", registration); },