javascript - Detect webgl support, should we use Detector.js or system.min.js? - Stack Overflow

It seems like Detector.js is used more often when I look around online, but I see that there is also th

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745376382a4625018.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信