From c31c5b6f57164ec39d426809d643e8850395b81f Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 2 Apr 2026 14:32:44 -0700 Subject: [PATCH] Tests WebGL availability by additionally checking for immediate context loss. --- src/lib/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3