diff --git a/client/public/sw.js b/client/public/sw.js
new file mode 100644
index 0000000..188a153
--- /dev/null
+++ b/client/public/sw.js
@@ -0,0 +1,31 @@
+self.addEventListener("push", (event) => {
+ let data = { title: "FOLX TV", body: "Neuer Inhalt verfügbar!", url: "/" };
+ try {
+ data = event.data.json();
+ } catch (e) {}
+ event.waitUntil(
+ self.registration.showNotification(data.title, {
+ body: data.body,
+ icon: "/favicon.png",
+ badge: "/favicon.png",
+ data: { url: data.url || "/" },
+ })
+ );
+});
+
+self.addEventListener("notificationclick", (event) => {
+ event.notification.close();
+ let url = event.notification.data?.url || "/";
+ if (!url.startsWith("/") || url.startsWith("//")) url = "/";
+ event.waitUntil(
+ clients.matchAll({ type: "window", includeUncontrolled: true }).then((clientList) => {
+ for (const client of clientList) {
+ if (client.url.includes(self.location.origin) && "focus" in client) {
+ client.navigate(url);
+ return client.focus();
+ }
+ }
+ return clients.openWindow(url);
+ })
+ );
+});
diff --git a/client/src/App.tsx b/client/src/App.tsx
index 6c88d8f..f3280bd 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -19,6 +19,7 @@ import ImpressumPage from "@/pages/impressum";
import DatenschutzPage from "@/pages/datenschutz";
import KontaktPage from "@/pages/kontakt";
import AdminGalleryPage from "@/pages/admin-gallery";
+import AdminPushPage from "@/pages/admin-push";
import CookieConsent from "@/components/cookie-consent";
function ScrollToTop() {
@@ -49,6 +50,7 @@ function Router() {