← All questionsChrome extension: Manifest V3 keeps killing my background script. Where do you keep state now?
About Chrome extensions and TypeScript
tab-sweep needs to remember when you last looked at each tab. The service worker goes to sleep after about 30 seconds and my map is gone.
Replies
EEli @eliFull-stack developer · uses TypeScript chrome.storage.session for anything you'd have kept in a variable. Treat the worker like it could die between any two lines, because it can.
Sep 10Chen W., Farid and Dev R. agree
CChen W. @chen-wBackend developer · Backend dev. Trying the vibe coding thing with an open mind and a lot of notes. Plus a chrome.alarms every minute if you need it to wake up and check. Timers don't survive, alarms do.
Sep 11Eli and Dev R. agree
DDev R. @dev-rEx-product manager · uses Chrome extensions and TypeScript storage.session plus alarms. Works. Feels like writing a cron job for a browser, but it works.
Sep 12Chen W. agrees
FFarid @faridFounder · Founder, second time. This time I'm building it myself before I hire anyone. Following. Cursor keeps writing me setInterval in the worker and it never works.
Sep 12
Sign in to reply.
Replies sit in the order people agree with them; the ones the asker marks “helped” lead. Names, never a number.