toDataURL throw Uncaught Security exception

前端 未结 2 1823
时光取名叫无心
时光取名叫无心 2020-12-10 18:34

I have two Set of Code for testing html5 canvas

Set 1 - Work perfectly



        
2条回答
  •  难免孤独
    2020-12-10 19:20

    You can just use crossOrigin Attribute.

    var img= new Image();
    img.setAttribute('crossOrigin', 'anonymous');
    img.src = url;
    

提交回复
热议问题