I'm having an issue with my extension -
one of the features that I'm trying to implement is a badge that counts down with a setTimeout timer, from a given amount of time down to 0 when the badge will clear out.
But I've been running into several issues, one of which being that the service worker will sometimes go inactive, killing the settimeout function and stopping the clock in the middle of the badge.
I've only just noticed because I guess while I hold the service worker inspect view open it may be keeping the worker alive longer than it does out in the wild, so to speak?
If I don't keep the inspect view open it often just dies 10s later, so even trying to set an alarm with a period of 1 minute isn't working for me.
So is there an optimal way to maintain the service worker's existence long enough to do a countdown effectively?