Skip to content

Commit f005c5a

Browse files
committed
fix(utils): simplify WebGL context detection logic
Remove instanceof WebGLRenderingContext check which was too restrictive. The getContext() method already returns null if WebGL is not supported, making the instanceof check unnecessary. This also properly supports WebGL2RenderingContext detection.
1 parent 5880386 commit f005c5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/webglDetect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function isWebGLSupported(): boolean {
1616
const gl = canvas.getContext('webgl2') || canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
1717

1818
// If we got a context, WebGL is supported
19-
if (gl && gl instanceof WebGLRenderingContext) {
19+
if (gl) {
2020
return true;
2121
}
2222

0 commit comments

Comments
 (0)