title: Write text content to a new window (or change the type of content from html to text)?
body: <p>How to prepare a text content to be readily saved by the user?</p>
  
  <pre><code>document.write("this text must be saved")
  </code></pre>
  
  <p>almost does the work, but the content of the page is perceived by the browsers as html, and will be saved as <code>html</code>. Can I change it to <code>text/plain</code>?</p>
  
  <p>I know I can generate it with "data:" uri, but then there is no way to specify the default file name. </p>
  
  <p>Thanks.</p>