I have two Set of Code for testing html5 canvas
Set 1 - Work perfectly
You can just use crossOrigin Attribute.
var img= new Image(); img.setAttribute('crossOrigin', 'anonymous'); img.src = url;