title: SecurityError: The operation is insecure in canvas.toDataURL
body: <p>I've tried to resolve the next error but without success.</p>
  
  <p>I have the following jQuery and HTML5 code:</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
  
    function doExportMap() {
  
        map.once('postcompose', function(event) {
  
          var canvas = event.context.canvas;
  
          var exportBMPElement = document.createElement('a');
          exportBMPElement.download = 'Mapa.bmp';
          exportBMPElement.href = canvas.toDataURL('image/bmp');
          document.body.appendChild(exportBMPElement);
          exportBMPElement.click();
          document.body.removeChild(exportBMPElement);
        });
  
        map.renderSync();
    }
  </code></pre>
  
  <p>It was working perfectly way, but now, I'm getting the following error:</p>
  
  <pre><code>SecurityError: The operation is insecure.
  exportBMPElement.href = canvas.toDataURL('image/bmp');
  </code></pre>
  
  <p>What is wrong? Any ideas?</p>
  
  <p>The funny is that I'm not loading the image from an external source. The image is from localhost</p>