Pause background tasks when Spider is not visible.
· One min read
Previously, when Spider tab was hidden in the browser, the background refresh tasks where still running, but browsers such as Chrome where blocking the network calls and slowing down Javascript timers.
This was generating a lot of error messages when the tab was made visible again.
After some documentation reading, Spider now listens to the event
visibilitychange
to know when it is visible on not, and deactivates background tasks when hidden, to restart them when made visible again.
No more pile of error messages in the morning! :)