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
+6
View File
@@ -53,6 +53,12 @@ async function main() {
});
addEventListener("hashchange", route);
route();
if ("serviceWorker" in navigator) {
navigator.serviceWorker.onmessage = (e) => {
location.hash = new URL(e.data.open, location.origin).hash;
};
await navigator.serviceWorker.register("/sw.js");
}
}
main().catch((err) => {
replace(document.body, h("pre", { class: "fatal" }, `byre failed to start: ${errorText(err)}`));