I figured it out. I added ui.html to "resources" in "web_accessible_resources" in manifest.json, and used (await fetch(chrome.runtime.getURL("ui.html"))).text() to get the HTML and store it in a variable in content.js to later inject. Thanks for trying to help. :)