JSFiddle - React, Tailwind, and code Playground

by Jeremy Banks

HTML

Putting a blob at a URL with a mime type:

JavaScript

var BlobBuilder = window.WebKitBlobBuilder || window.MozBlobBuilder || window.BlobBuilder;
var FileWriter = window.WebKitFileWriter

window.webkitRequestFileSystem(TEMPORARY, 1024, function(fs) {  
  fs.root.getFile('foo.html', { create: true }, function(fileEntry) { 
    fileEntry.createWriter(function(writer){
    writer.onwriteend = function() {
      window.location = fileEntry.toURL();
    };
    
    var bb = new BlobBuilder;
    bb.append("Hello, <b>world</b>!");
    var blob = bb.getBlob("text/html");
    
    writer.write(blob);
});
  });
});