2
0
Эх сурвалжийг харах

Improve WebGL 2 detection in iframes (#25733)

* adjusts to directly check the gl.constructor.name instead of instanceof

* spacing
antpb 2 жил өмнө
parent
commit
d99c79635f

+ 1 - 1
src/renderers/webgl/WebGLCapabilities.js

@@ -52,7 +52,7 @@ function WebGLCapabilities( gl, extensions, parameters ) {
 
 	}
 
-	const isWebGL2 = typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext;
+	const isWebGL2 = typeof WebGL2RenderingContext !== 'undefined' && gl.constructor.name === 'WebGL2RenderingContext';
 
 	let precision = parameters.precision !== undefined ? parameters.precision : 'highp';
 	const maxPrecision = getMaxPrecision( precision );