Canvas with webgl becomes broken after some time

I have a page where I use multiple canvases with webgl2 context. When I load or refresh page everything works good (rendering in canvases). But if I go to other tab in browser or switch focus to other app, and then return back to my page some canvases may become broken.

In my case “broken” means following:

Double buffering seems not to work correctly. In one buffer drawing seems to be working, in other buffer not. Broken buffer just displays the same frame each time. So I see blinking in canvas.

I want to know if I can fix such behavior or somehow trigger if canvas is broken.