问题
I have a Tumblr theme that includes a canvas
script.
The Cross-Origin Resource Sharing policy doesn't allow context.getImageData()
to work. Script is located at user.tumblr.com,
images are located at static.tumblr.com.
Is there any solution for this?
Thank you!
回答1:
document.domain will be your friend there.
I haven't studied the canvas security model closely, but if it follows the rest of Javascript, setting
document.domain = tumblr.com
might help.
(Googling for document.domain canvas may lead to more.)
来源:https://stackoverflow.com/questions/14474194/cross-origin-resource-sharing-policy-between-subdomains-in-js