最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论