Преглед изворни кода

Improve WebGL 2 detection in iframes (#25733)

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

* spacing
antpb пре 2 година
родитељ
комит
d99c79635f
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/renderers/webgl/WebGLCapabilities.js

+ 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 );