admin管理员组

文章数量:1424458

It seems like Detector.js is used more often when I look around online, but I see that there is also the minified system.min.js file: .js

This may be trivial, but I'm wondering which is proper to use, and why most people seem to be using Detector (from what I've seen, at least). They both seem to do the task.

It seems like Detector.js is used more often when I look around online, but I see that there is also the minified system.min.js file: https://github./mrdoob/system.js

This may be trivial, but I'm wondering which is proper to use, and why most people seem to be using Detector (from what I've seen, at least). They both seem to do the task.

Share Improve this question edited Feb 3, 2014 at 17:08 Quonux 2,9911 gold badge25 silver badges32 bronze badges asked May 12, 2013 at 5:17 dmonopolydmonopoly 3,3315 gold badges36 silver badges53 bronze badges 1
  • If they both do the same thing, it probably doesn't matter. Just pick one. – icktoofay Commented May 12, 2013 at 5:29
Add a ment  | 

1 Answer 1

Reset to default 5

It appears that System.js and Detector.js both use the same snippet of code for detecting WebGL. Namely:

var supportsWebGL = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )();

If that's all you need to detect, you could just use that directly.

本文标签: javascriptDetect webgl supportshould we use Detectorjs or systemminjsStack Overflow