// Webkit will throw security error when image used on canvas and canvas.toDataUrl()
return new Promise((resolve, reject) => {
let image = new Image();
img.onload = () => {resolve(image)}
img.src = `${url}?${Date.now()}`;
img.crossOrigin = ""
})
// Webkit will not throw security error when image used on canvas and canvas.toDataUrl()
return new Promise((resolve, reject) => {
let img = new Image()
img.onload = () => {resolve(img)}
img.crossOrigin = ''
img.src = `${url}?${Date.now()}`
})
网友评论