Disclaimer: this is my first time creating a chrome extension and I'm not very experienced with JS.
I have a contentscript that generates an XML string, and I want to prettify the string to make it easier to read. All other ways I found to do this, mess with the CDATA sections of the XML one way or another, so I figured I would use this npm module.
I have tried to import it in every way but can't get it to work. From what I saw the best way should be to add the script to the manifest in the web-accessible-resources, and then import it like so:
const src = chrome.runtime.getURL("xml-formatter-singleton.js");
const formatter = await import(src);
var formattedXmlString = formatter.formatXml(xmlString);
console.log(formattedXmlString);
What am I missing?