ctrlplusb / react-universally

A starter kit for universal react applications.
MIT License
1.7k stars 244 forks source link

Canvas and CORS #485

Closed designspin closed 7 years ago

designspin commented 7 years ago

I have stumbled onto a problem in Development only.

I am loading images provided by Webpack in development onto img src tags and then trying to use the images data (getImageData) on a Canvas element. When I do this, I get a complaint that the canvas is tainted by cross origin data.

Does anybody know how I can get around this in development? It all works out fine on a final build, but kind of annoying that I have to produce a build just to test my work!

designspin commented 7 years ago

looks like img.crossOrigin = 'anonymous' works for this actually!