0

I'm aiming to create a Chrome extension that performs tasks across multiple URL changes and continues running even when a tab is out of focus. I've noticed that some extensions are able to do this, and I'm keen on understanding the mechanics behind it to implement it for my own extension.

To clarify, the task I want my extension to perform needs to run from 10 - 20 minutes and spans multiple page reloads, I would also like it to continue even if the user switches tabs.

From my understanding, background scripts in extensions have a short-lived life cycle and they are no longer able to handle long-running tasks as they used to. Therefore, I am wondering how other extensions manage to run tasks persistently in such a scenario.

Miguel Dey
  • 187
  • 1
  • 5
  • You can [maintain the state](/a/73090402) in chrome.storage or [prolong the lifetime](/a/66618269) of the background script. – wOxxOm Jun 23 '23 at 04:46

0 Answers0