title: Is there an equivalent of canvas's toDataURL method for SVG?
body: <p>I am trying to load an svg image into canvas for pixel manipulation
  I need a method like <code>toDataURL</code> or <code>getImageData</code> for svg</p>
  
  <p>on Chrome/Safari I can try doing it through and image and canvas</p>
  
  <pre><code>var img = new Image()
  img.onload = function(){
    ctx.drawImage(img,0,0) //this correctly draws the svg image to the canvas! however...
    var dataURL = canvas.toDataURL(); //SECURITY_ERR: DOM Exception 18
    var data = ctx.getImageData(0,0,img.width, img.height).data //also SECURITY_ERR: DOM Exception 18
    }
    img.src = "image.svg" //that is an svg file. (same domain as html file :))
  </code></pre>
  
  <p>But I get security errors. 
  Any other way?</p>
  
  <p>Here is a live demo of the problem <a href="http://clstff.appspot.com/gist/462846" rel="noreferrer">http://clstff.appspot.com/gist/462846</a> (you can view source)</p>