Security Error with canvas.toDataURL() and drawImage()

后端 未结 3 768
[愿得一人]
[愿得一人] 2020-12-11 05:59


3条回答
  •  轮回少年
    2020-12-11 07:02

    You are right, this is a security feature, not a bug.

    If reading the Image (for instance with toDataURL or getImageData) would work, you could also read https://mail.google.com/mail/ from the context of your visitor get his emails or whatever.

    Therefore, canvas elements have a origin-clean flag, which is set when external images are written to the canvas. In that case, you can no longer read from it.

    You can read more about this topic here.

提交回复
热议问题