W3Schools document.open()
document.open(“text/plain”) formatting ignored in WebKit (Safari, Chrome)
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function displayInNewWindow() {
var win;
var doc;
win = window.open("", "WINDOWID");
doc = win.document;
doc.open("text/plain");
doc.write("Line1\tField2\tField3\nLine2\tField2\tField3\n");
doc.close();
}
</script>
</head>
<body>
<script type="text/javascript">displayInNewWindow();</script>
<p>We're here!</p>
</body>
</html>