When tab moves to the background, Chrome puts the current code to sleep. Use Web Workers to solve this issue.