From 59aedfaab22c5ee942df236cfd03e8cf5f84643a Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 2 Apr 2026 14:30:33 -0700 Subject: [PATCH] Check for immediate WebGL context loss for API availability. --- src/utils/api-support/webgl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3