Use a Javascript web worker and setInterval to power a game loop that continues running even when the browser is inactive.