Add web push notifications for new inbox items
This commit is contained in:
Vendored
+6
@@ -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)}`));
|
||||
|
||||
Reference in New Issue
Block a user