1

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

  • Possible duplicate of http://stackoverflow.com/questions/2745432/best-way-to-detect-that-html5-canvas-is-not-supported – sachleen Jun 22 '12 at 21:26

2 Answers2

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.

eivers88
  • 6,207
  • 1
  • 33
  • 34
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

Simon Sarris
  • 62,212
  • 13
  • 141
  • 171