diff --git a/src/handlers.js b/src/handlers.js index ab88061..216006b 100644 --- a/src/handlers.js +++ b/src/handlers.js @@ -3,6 +3,15 @@ function(Filer, Async, Log, Content) { var Path = Filer.Path; + /** + * Open, Write to the document stream, and Close. + */ + function _writeMarkup(markup) { + document.open(); + document.write(markup); + document.close(); + } + /** * Given an HTML string, rewrite it with inline resources */ @@ -108,7 +117,7 @@ function(Filer, Async, Log, Content) { rewriteElements('iframe', 'src', null, callback); } ], function callback(err, result) { - document.write(doc.documentElement.innerHTML); + _writeMarkup(doc.documentElement.innerHTML); }); } @@ -183,7 +192,7 @@ function(Filer, Async, Log, Content) { '