title: Convert canvas to an image with JavaScript
body: <p>I want to convert canvas to an image with JavaScript, When I try to <code>canvas.toDataURL(&quot;image/png&quot;);</code>  It gives the following error</p>
  <blockquote>
  <p>SecurityError: The operation is insecure</p>
  </blockquote>