summaryrefslogtreecommitdiff
path: root/app/views/pwa/service-worker.js
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2024-11-11 16:55:14 +0100
committerMarius Peter <marius.peter@tutanota.com>2024-11-11 16:55:14 +0100
commitfea9476a591559bd8fdcf17b64e5114c592a5b08 (patch)
tree08aa0fdd62752f1d286aa66ac77413fb03d6d737 /app/views/pwa/service-worker.js
C'est l'heure d'assurer le suivi de quelques flacons!main
Diffstat (limited to 'app/views/pwa/service-worker.js')
-rw-r--r--app/views/pwa/service-worker.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/views/pwa/service-worker.js b/app/views/pwa/service-worker.js
new file mode 100644
index 0000000..b3a13fb
--- /dev/null
+++ b/app/views/pwa/service-worker.js
@@ -0,0 +1,26 @@
+// Add a service worker for processing Web Push notifications:
+//
+// self.addEventListener("push", async (event) => {
+// const { title, options } = await event.data.json()
+// event.waitUntil(self.registration.showNotification(title, options))
+// })
+//
+// self.addEventListener("notificationclick", function(event) {
+// event.notification.close()
+// event.waitUntil(
+// clients.matchAll({ type: "window" }).then((clientList) => {
+// for (let i = 0; i < clientList.length; i++) {
+// let client = clientList[i]
+// let clientPath = (new URL(client.url)).pathname
+//
+// if (clientPath == event.notification.data.path && "focus" in client) {
+// return client.focus()
+// }
+// }
+//
+// if (clients.openWindow) {
+// return clients.openWindow(event.notification.data.path)
+// }
+// })
+// )
+// })
Copyright 2019--2024 Marius PETER