Add web push notifications for new inbox items

This commit is contained in:
Ian Gulliver
2026-10-14 21:25:01 -07:00
parent 01c60d6618
commit 8e4c40eb5f
40 changed files with 1724 additions and 202 deletions
+7
View File
@@ -59,6 +59,13 @@ async function main(): Promise<void> {
addEventListener("hashchange", route);
route();
if ("serviceWorker" in navigator) {
navigator.serviceWorker.onmessage = (e: MessageEvent<{ open: string }>) => {
location.hash = new URL(e.data.open, location.origin).hash;
};
await navigator.serviceWorker.register("/sw.js");
}
}
main().catch((err: unknown) => {