I'm using rackspace to host my image files that are drawn on an html5 canvas object. Because of an HTML security feature when saving a canvas I have to use CORS (Cross Origin Resource Headers) to make save work.
I have tested my code on Chrome, IE with Chrome Frame, and Firefox, and none of them give me a security error after I added to the image request headers:
Access-Control-Allow-Origin: *
and I have added the following attribute to all the images drawn on to the canvas
crossOrigin = "anonymous"
However, for some reason Safari still gives a security error.
SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
Any thoughts as to why this is happening on safari(desktop 5.1.7, and ipad) versions? I have checked the documentation and everything I have read says that Safari 4+ supports CORS?
Safari 5.2 in beta solves the problem. So it looks like Safari does not yet support cors for images in released versions. The same goes for iOS safari
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With