kennethcachia / background-check

Automatically switch to a darker or a lighter version of an element depending on the brightness of images behind it.
http://kennethcachia.com/background-check/
MIT License
3.27k stars 281 forks source link

CORS issue - possibly with CDN provider? #75

Open ohNegative opened 9 years ago

ohNegative commented 9 years ago

I have a static site that I'm hosting with Netlify (http://copy-writer-otter-74032.netlify.com/). I was running it on my local WAMP server without any issues, in any browser. Once I deployed my site to their servers, I got 6 errors, all related to CORS:

Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.

I'm bringing this up to say I'm pretty sure its NOT your script, but I'm guessing there might be an issue if you use your script with a CDN provider? I'm guessing this is why it works fine on my local WAMP server, but on a CDN provider, the images are seen as coming from a foreign origin so browsers suddenly freak out and throw the errors I was seeing above?

I have a ticket in with Netlify to see what they can determine and will keep you posted. I looked through the current issues here, and although there are two tickets regarding CORS, neither had my same issue.

Let me know if you have any experience with similar problems.

P

indfnzo commented 8 years ago

Have you found a solution to this?

I'm having this same problem currently.

rodolfogordo10 commented 7 years ago

There's a PR fixing this. #60