Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #15 from pigucatalin/master

Contains fix for issue #13, the error when checking if WebGL is supported
  • Loading branch information...
commit 977f647f8b91be57a9fe36b78556ff744eaed295 2 parents aa10c07 + e42ceb2
@oslego oslego authored
Showing with 19 additions and 3 deletions.
  1. +19 −3 lib/application.js
View
22 lib/application.js
@@ -175,9 +175,25 @@
},
checkWebGLSupport: function(property, value) {
- var canvas = document.createElement('canvas');
- context = canvas.getContext("experimental-webgl");
- return !!context;
+ var isCanvasSupported = true;
+ var isWebGlSupported = true;
+ try{
+ var canvas = document.createElement('canvas');
+ }
+ catch(err){
+ isCanvasSupported = false;
+ }
+
+ try{
+ var context = canvas.getContext("experimental-webgl");
+ }
+ catch(err){
+ isWebGlSupported = false;
+ }
+ if (!(isCanvasSupported && isWebGlSupported)){
+ return null;
+ }
+ return !!context;
},
checkFeatures: function() {
Please sign in to comment.
Something went wrong with that request. Please try again.