0

I wanna constantly get the DOM data,then pass them to my extension's background when the page isn't active,but I realize the script will run slowly at the period of time.So could you tell me if there were the ways to run script without limitation even when the page isn't active?

Chicken
  • 1
  • 1
  • The content script runs setTimeout(function,50) while passing the datas to the background page.It works very well when the page is active,but the 50ms will be about 1000ms when the page is not active. – Chicken Aug 06 '16 at 14:30
  • It's better to reorganize the workflow and not use setTimeout at all, though. – wOxxOm Aug 06 '16 at 14:34
  • Thank you very much!I will definitely try it! – Chicken Aug 06 '16 at 14:40
  • There's also a [setImmediate](https://github.com/YuzuJS/setImmediate) hack, which is probably easier to use than a web worker. – wOxxOm Aug 06 '16 at 14:47

0 Answers0