From 1651ce848ac03ee867473d361c200ea863aef83f Mon Sep 17 00:00:00 2001 From: altaf-creator <64111012+altaf-creator@users.noreply.github.com> Date: Thu, 4 May 2023 19:17:15 +0700 Subject: PWA Update - attempt 1 --- src/scripts/main.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/scripts/main.js (limited to 'src/scripts/main.js') diff --git a/src/scripts/main.js b/src/scripts/main.js new file mode 100644 index 0000000..e4efee0 --- /dev/null +++ b/src/scripts/main.js @@ -0,0 +1,9 @@ +if ("serviceWorker" in navigator) { + window.addEventListener("load", function () { + + navigator.serviceWorker + .register("scripts/service-worker.js") + .then(res => console.log("service worker registered")) + .catch(err => console.log("service worker not registered", err)) + }) +} \ No newline at end of file -- cgit v1.2.3