If I try to get image data from a canvas that has an image drawn to it, I get a security error. I decided to make a small demonstration of the error so anybody with an answer wouldn’t have to look through all of my other code and could still see the error themselves. Then, when I uploaded the demonstration, there wasn’t an error. I still get this error with the local files on my computer. Why does it work online when it doesn’t work locally? Is there any way to fix this problem? The demonstration can be found here.
Share
Images with an origin of
file:///are always considered unclean. I outlined the reasons a little while ago here. Essentially, if the rules were not that way, a javascript app could do a (very) rudimentary scan of your harddrive and try to find images and upload them without your consent.Some browsers like chrome have flags that allow you to ignore that security rule for dev testing. I think the flag for Chrome is
--disable-web-security