kogmbh/WebODF — pull request #843 by HaBaLeS (2014-10-28 11:39:39+00:00)
Title: Added support for Data-URI scheme in runtime.js readFile(....)

I would like to be able to have a single HTML File with WebODF and the Document to show embedded. The BrowserRuntime.readFile(..) did not support this. It always tried to fetch the URI via XHR.

This Patch checks the URL if it is a Data-URI and if so skips the XHR Request.

You can use this to open Documents like this:

var base64Data = [some preencoded odt file as string ]
var dataURL = "data:application/vnd.oasis.opendocument.text;base64," + base64Data
odfcanvas.load(odtDataURL);