1

Please tell, how can i determine, the browser supports canvas (paperjs), or not ?

1

2 Answers 2

2

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.

1

var canvasExists = document.createElement('canvas').getContext !== undefined;

Will be true in Chrome, false in IE8, etc.

You could also check for window.HTMLCanvasElement !== undefined

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.