I am writing a simple toy using canvas and pure js. Faced such a problem: if you minimize the browser, switch to another tab, the canvas freezes and does not move. ( requestAnimationFrame() is not called)

I understand that the browser is so arranged, but maybe there is a solution after all?

    1 answer 1

    Use setInterval instead of requestAnimationFrame .