Reputation: 1045
Please tell, how can i determine, the browser supports canvas (paperjs), or not ?
Upvotes: 1
Views: 198
Reputation: 6247
I recommend using Modernizr for html5 canvas support detection. With Modernizr, it is as simple as
if(Modernizr.canvas) {
//HTML5 canvas action
}
for reliable and consistent detection across all browsers.
Upvotes: 2
Reputation: 63812
var canvasExists = document.createElement('canvas').getContext !== undefined;
Will be true
in Chrome, false
in IE8, etc.
You could also check for window.HTMLCanvasElement !== undefined
Upvotes: 1