From: Chris Duncan Date: Thu, 2 Apr 2026 21:30:33 +0000 (-0700) Subject: Check for immediate WebGL context loss for API availability. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=59aedfaab22c5ee942df236cfd03e8cf5f84643a;p=nano-pow.git Check for immediate WebGL context loss for API availability. --- diff --git a/src/utils/api-support/webgl.ts b/src/utils/api-support/webgl.ts index c31c4ef..7d87b71 100644 --- a/src/utils/api-support/webgl.ts +++ b/src/utils/api-support/webgl.ts @@ -7,7 +7,7 @@ Object.defineProperty(webgl, 'isSupported', { let isWebglSupported = false try { const gl = new OffscreenCanvas(0, 0)?.getContext?.('webgl2') - isWebglSupported = (gl instanceof WebGL2RenderingContext) + isWebglSupported = (gl instanceof WebGL2RenderingContext && !gl.isContextLost()) } catch (err) { console.warn('WebGL is not supported in this environment.\n', err) isWebglSupported = false