I use a lot of TWebTimer components in my project and they work pretty well. However, I recently learned that timers do not get triggered on a web page when that page is not active. Not really the fault of TWebTimer apparently, as this is a browser-enforced limitation and is enforced consistently across all of the browsers I use regularly.
In my case though I wanted to use a timer to display an automatic logout countdown delay popup message. The problem was this wasn't firing until the page was active again, perhaps long after the automatic logout had occurred (JWT expired in my case). So not really ideal.
<!-- HackTimer --> <script src="https://cdn.jsdelivr.net/npm/hacktimer@latest/HackTimer.silent.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/hacktimer@latest/HackTimerWorker.min.js"></script>
It is a bit overkill in that I don't really need all of my timers to use this mechanism, but as most of them are very short-duration UI-type timers, this isn't a big problem in my case. And my very limited understanding was that this was kind of an all-or-nothing approach, but I could be wrong there.
Does anyone know of a better workaround? Been using this for awhile with no issues so I'm happy with the end result, but it is an external dependency (and an aging one at that) that may have a more current or more appropriate solution?