How can I keep the script in the extension running?
I've got a popup.html and my script needs to run on this popup.html. I set the timer, I'm starting it and it starts to count down, once I close the popup, the timer stops. Apparently, the whole popup.html is unloaded once I click away.
Have a look at Web Workers: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
These run in the background indepently from your window context.
Edit: I just checked this again and as @wOxxOm correctly states in his comment you should use Background Pages in chrome extensions. The link provides an example: https://developer.chrome.com/extensions/background_pages
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With