From 07bb17a196cf91e9acf80c4cd83b03a629a73ea4 Mon Sep 17 00:00:00 2001 From: manuelsanchez2 Date: Mon, 8 Jul 2024 19:36:45 +0200 Subject: [PATCH] Try with pwa --- public/sw.js | 1 + src/components/router-head/router-head.tsx | 14 ++++++++++++++ src/routes/service-worker.ts | 18 ------------------ 3 files changed, 15 insertions(+), 18 deletions(-) create mode 100644 public/sw.js delete mode 100644 src/routes/service-worker.ts diff --git a/public/sw.js b/public/sw.js new file mode 100644 index 0000000..5a9356a --- /dev/null +++ b/public/sw.js @@ -0,0 +1 @@ +importScripts("https://cdn.pushalert.co/sw-72059.js"); \ No newline at end of file diff --git a/src/components/router-head/router-head.tsx b/src/components/router-head/router-head.tsx index 9892aad..6af17d9 100644 --- a/src/components/router-head/router-head.tsx +++ b/src/components/router-head/router-head.tsx @@ -8,6 +8,18 @@ export const RouterHead = component$(() => { const head = useDocumentHead() const loc = useLocation() + const scriptToAdd = ` + + + (function(d, t) { + var g = d.createElement(t), + s = d.getElementsByTagName(t)[0]; + g.src = "https://cdn.pushalert.co/integrate_0e441160613d873bb57688051624e3da.js"; + s.parentNode.insertBefore(g, s); + }(document, "script")); + + ` + return ( <> {head.title} @@ -30,6 +42,8 @@ export const RouterHead = component$(() => { {head.styles.map((s) => (