Keep cached cycles active in background tabs

This commit is contained in:
Theodore Song
2026-08-18 08:03:29 -04:00
parent e4e27c885a
commit b906e9654d
4 changed files with 33 additions and 3 deletions
+11
View File
@@ -0,0 +1,11 @@
const INTERVAL_MS = 60000;
postMessage({ type: "ready", at: Date.now() });
self.onmessage = event => {
if(event.data && event.data.type === "ping") postMessage({ type: "ready", at: Date.now() });
};
setInterval(() => {
postMessage({ type: "cycle", at: Date.now() });
}, INTERVAL_MS);