title: html2canvas Generates Blank if canvas is NOT added to body
body: <p>The idea is simple and widely described :
  Take a screenshot using html2canvas plugin, then, send the image using Ajax to server .</p>
  
  <p>To do so, I use</p>
  
  <pre><code>html2canvas(document.querySelector("body"))
      .then(canvas =&gt; {
  
          document.body.appendChild(canvas) // =&gt; pay attention to this line
  
          const b64 = canvas.toDataURL("image/png").replace(/.*,/, '');
          theFunctionThatSendB64UsingAjax(b64)
          return;
       })
  </code></pre>
  
  <p>So, this elegant piece of code works pretty fine ! 
  It generates a canvas element, attach it to body and then send a base64 format string to the server.</p>
  
  <p>But  I don't want to display the canvas nor the image. So, the obvious is to remove the line :</p>
  
  <pre><code>document.body.appendChild(canvas)
  </code></pre>
  
  <p>When I do so, the generated image is always blank.</p>
  
  <p>PS: this issue only happens on Firefox ! it works fine on Chrome</p>
  
  <p>So, is there anybody out there with at least a clue ?! 
  Or, an alternative to html2canvas.</p>
  
  <p>And, if matters, the server is running a golang script that store the image in a mongodb .
  The server side works fine !</p>
  
  <p>html2canvas version 1.0.0-rc.5 !</p>
  
  <p>EDIT :</p>
  
  <p>This issue does not happens on v0.4 as described in answer below !</p>
  
  <p>EDIT:</p>
  
  <p>I Opened an issue on github:</p>
  
  <p><a href="https://github.com/niklasvh/html2canvas/issues/2254" rel="nofollow noreferrer">https://github.com/niklasvh/html2canvas/issues/2254</a></p>