In my extension, I'm creating a new tab and would like to write my own html to it - that's generated dynamically.
Can it be done.
I'm calling chrome.tabs.create()
to create a new tab - now I just need to write my data as an HTML file to it.
Easiest way to do this would be using a data: URL. E.g. something like this:
var htmlCode = "<html><body>Hi!</body></html>";
var url = "data:text/html," + encodeURIComponent(htmlCode);
chrome.tabs.create({url: url});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With