Good day.
Is it possible to get the contents of the image (in the form of base64 or dataURL), somehow ignoring the cross-origin polycy in the browser?
So, for example, code ( sandbox here ):
function dataURL (src, callback) { var img = new Image; img.onload = function () { var canvas = document.createElement("canvas"); canvas.width = img.width; canvas.height = img.height; canvas.getContext("2d").drawImage(img, 0, 0); try { callback(canvas.toDataURL()); } catch (e) { alert(e); } }; img.src = src; } // Используем dataURL( "http://a.disquscdn.com/uploads/users/10355/3829/avatar92.jpg?1413802608", function (data) { alert(data); } );
It does not work, but gives an error: The operation is insecure. code: "18"
The operation is insecure. code: "18"