What is the right way to handle webgl context lost?


I work on win10, and i dont know the reason but sometimes cesium crash because webgl lost the context.

I think maybe it happend because chrome use a lot of GPU, maybe…

Of course i can write event listener like this:

canvas.addEventListener('webglcontextlost', (event) => {

But this solution will reload the entire web page.

What is the right way to handle it?

Thanks in advance.

By the way, my solution above not working. Because right after the web page reloaded cesium crash with the known error:

Error constructing CesiumWidget
visit get.webgl.org to verify that your web browser and harware support WebGL. Etc... 

Help! What to do?