Cross-origin image load denied by Cross-Origin Resource Sharing policy

后端 未结 1 1478
别跟我提以往
别跟我提以往 2021-01-22 12:07

I use html2canvas (from html2canvas.hertzen.com) to capture screenshot. I got this strange error like this: The code of my webpage is put on one host, say Host A. If my webpag

1条回答
  •  温柔的废话
    2021-01-22 12:49

    If you wish to load cross-origin images to a canvas, you need to either serve the image with cross-origin headers or under the same origin. That image under Facebook is served with the following header option set:

    Access-Control-Allow-Origin:*

    Meaning, it can be cross-origin loaded with the useCORS option. However, it would appear that your Host B isn't serving them with cross-origin headers set.

    0 讨论(0)
提交回复
热议问题