color-thief
color-thief copied to clipboard
Async.html is broken on Firefox and Safari
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?
Bump