android - How to overcome security exception when loading image? -


i using following code load image amazon s3 storage android webview:

var img = new image(); img.crossorigin = 'anonymous'; img.src = <my.s3.amazon/image.jpg>;  img.onload = function() {        var canvas = document.createelement("canvas");     canvas.width = img.width;     canvas.height = img.height;      var context = canvas.getcontext("2d");     context.drawimage(img, 0, 0);      var result = canvas.todataurl(); } 

the last line throws security_err: dom exception 18. know caused image being loaded foreign domain. how resolve this?


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -