浏览代码

Added getContext( 'webgl' ) check in Detector.
https://bugzilla.mozilla.org/show_bug.cgi?id=912606

Mr.doob 12 年之前
父节点
当前提交
32cf8fc549
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/js/Detector.js

+ 1 - 1
examples/js/Detector.js

@@ -6,7 +6,7 @@
 var Detector = {
 var Detector = {
 
 
 	canvas: !! window.CanvasRenderingContext2D,
 	canvas: !! window.CanvasRenderingContext2D,
-	webgl: ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(),
+	webgl: ( function () { try { var canvas = document.createElement( 'canvas' ); return !! window.WebGLRenderingContext && !! canvas.getContext( 'webgl' ) && !! canvas.getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(),
 	workers: !! window.Worker,
 	workers: !! window.Worker,
 	fileapi: window.File && window.FileReader && window.FileList && window.Blob,
 	fileapi: window.File && window.FileReader && window.FileList && window.Blob,