title: downloading a javascript blob variable as mhtml
body: <p>I'm writing a google chrome extension that uses</p>
  
  <pre><code>chrome.pageCapture.saveAsMHTML(object details, function callback)
  function callback (blob mhtmlData) {...};
  </code></pre>
  
  <p><a href="http://code.google.com/chrome/extensions/dev/pageCapture.html" rel="nofollow">http://code.google.com/chrome/extensions/dev/pageCapture.html</a></p>
  
  <p>which basically stores a blob representation of an mhtml page into a variable.</p>
  
  <p>Now I want to let the user download this blob variable as an mhtml file..</p>
  
  <p>I tried this but is gives me a 200kb file filled with random characters.</p>
  
  <pre><code>chrome.pageCapture.saveAsMHTML({tabId: sender.tab.id}, function callback(mhtml){
  
      var reader = new FileReader();
      reader.readAsDataURL(mhtml);
  
      reader.onload = function(e) {
          window.open(e.target.result);
      }
  
  
  }); 
  </code></pre>