Browse Source

I think these are the proper ways to detect <canvas> and WebGL.

Mr.doob 14 years ago
parent
commit
5ad6b0b59a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/extras/Detector.js

+ 3 - 3
src/extras/Detector.js

@@ -6,8 +6,8 @@ THREE.Detector = {
 	
 	// supported features
 	
-	canvas	: !!document.createElement( 'canvas' ).getContext,
-	webgl	: window.Uint8Array != undefined,
+	canvas	: !!window.CanvasRenderingContext2D, // !!document.createElement( 'canvas' ).getContext,
+	webgl	: !!window.WebGLRenderingContext, // window.Uint8Array != undefined,
 	workers : !!window.Worker,
 	
 	// helper methods
@@ -59,4 +59,4 @@ THREE.Detector = {
 
 	}
 	
-};
+};