Is there a way to load a DOM document dynamically created from the scope of a Firefox extension to a tab in the current browser?
I would like to create an HTML report from a Firefox extension and load it in a new tab in the browser.
var doc = document.implementation.createDocument ('http://www.w3.org/1999/xhtml', 'html', null);
var body = document.createElementNS('http://www.w3.org/1999/xhtml', 'body');
doc.documentElement.appendChild(body);
var div = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
div.appendChild(document.createTextNode("New HTML doc");
body.appendChild(div)
//How to load this document in a new tab?
So far, I have only achieved to append the dynamically generated content in the body of an empty template located in the extension directory (chrome://myextension/content/template.html).
Any help would be greatly appreciated.