我正在使用画布制作类似于Web应用程序的绘画,它可以在Firefox上正常工作,但是当我在chrome上重新加载页面并使用.ToDataURL函数时,它给我一个错误的消息,即可能无法导出污染的画布
canvas = document.getElementById('can');
ctx = canvas.getContext("2d");
widthOfCanvas = canvas.width;
highOfCanvas = canvas.height;
var image = new Image();
image.src='https://scontent.fkhi9-1.fna.fbcdn.net/v/t1.0-9/53169476_2381573508543072_5059610343865581568_n.png?_nc_cat=102&_nc_ht=scontent.fkhi9-1.fna&oh=bad33f4d78d743ed41c3455dcde6eeae&oe=5CE3CD71';
image.crossOrigin="anonymous";
console.log(image.onload)
image.onload = function(){
ctx.drawImage(image, 0, 0 ,widthOfCanvas,highOfCanvas);
}