Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to quickly determine if a browser supports CORS-enabled images not tainting the browser?

Is there a quick test to determine if a browser supports CORS-enabled images not tainting a canvas when drawn on them. I know Chrome 15 supports this, Firefox 9Beta but not Firefox 8, Safari doesn't, IE9 doesn't. But there must be a pretty simple test to determine this, is basically drawing on a canvas with an image and seeing if you get an exception when you try to get image data, or is there any other easy way to determine this.

like image 372
Kris Erickson Avatar asked Dec 08 '11 23:12

Kris Erickson


1 Answers

This seems to work:

if ('crossOrigin' in new Image())
    // ...
like image 70
Casey Chu Avatar answered Oct 10 '22 06:10

Casey Chu