color-thief icon indicating copy to clipboard operation
color-thief copied to clipboard

Async.html is broken on Firefox and Safari

Open mrobe opened this issue 7 years ago • 1 comments

I would like to use ColorThief to analyze an image loaded from another domain.

I tried the async.html example, but it gives the following errors on Safari 11.0:

[Error] Unable to get image data from canvas because the canvas has been tainted by cross-origin data. [Error] SecurityError (DOM Exception 18): The operation is insecure. [Error] Origin null is not allowed by Access-Control-Allow-Origin. [Error] Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. (200, line 0) [Error] XMLHttpRequest cannot load http://lorempixel.com/400/200/ due to access control checks.

And on Firefox 55.0.3:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://lorempixel.com/400/200/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Any suggestions about how to make this work?

mrobe avatar Oct 01 '17 23:10 mrobe

Bump

mrobe avatar Nov 08 '17 04:11 mrobe