From: Chris Duncan Date: Thu, 2 Apr 2026 21:32:44 +0000 (-0700) Subject: Tests WebGL availability by additionally checking for immediate context loss. X-Git-Tag: v4.1.9~1 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=c31c5b6f57164ec39d426809d643e8850395b81f;p=nano-pow.git Tests WebGL availability by additionally checking for immediate context loss. --- diff --git a/src/lib/index.ts b/src/lib/index.ts index e20fb54..99f408f 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -14,7 +14,7 @@ try { } try { const gl = new OffscreenCanvas(0, 0)?.getContext?.('webgl2') - isGlSupported = (gl instanceof WebGL2RenderingContext) + isGlSupported = (gl instanceof WebGL2RenderingContext && !gl.isContextLost()) } catch (err) { console.warn('WebGL is not supported in this environment.\n', err) isGlSupported = false