title: Creating / downloading a .html file with a chrome extension
body: <p>I'm building my first Chrome extension. So far my code takes elements of a webpage and creates HTML markup (loaded in a string in Javascript).</p>
  
  <p>My extension leads in a button </p>
  
  <pre><code>$(".column1").prepend('&lt;div class="actions" style="margin-bottom: 1rem;"&gt;&lt;button id="edmMaker"&gt;Make an EDM!&lt;/a&gt;&lt;/div&gt;')
  $('#edmMaker').click(function(){
      var html = "&lt;body&gt;&lt;section&gt;&lt;h1&gt;Here is some HTML text&lt;/h1&gt;&lt;/section&gt;&lt;div&gt;&lt;p&gt;Here's some more&lt;/p&gt;&lt;/div&gt;&lt;/body&gt;"
      // create a .html file and download it to the user's desktop
  });
  </code></pre>
  
  <p>In Node.JS I would just write a <code>.html</code> file to the local disk, but I can't quite figure out how this works in Chrome Extension world.</p>
  
  <p>How can I do this?</p>
  
  <p>Sub-question: Is there any way to tabify the HTML that is being output? The actual code I'm outputting is an HTML email template, and Javascript will only let me load in a string without line breaks and tabs.</p>