From: Chris Duncan Date: Thu, 2 Apr 2026 21:39:35 +0000 (-0700) Subject: Tests WebGL availability by additionally checking for immediate context loss. X-Git-Tag: v5.1.13~1 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=3882c3b5e00ffe475d8a33dcad6ffb7b8d1f6992;p=nano-pow.git Tests WebGL availability by additionally checking for immediate context loss. --- 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