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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -