The resulting html file has a combination of inline and external scripts in a variety of different places. For the sake of example, let's assume the html of the asset looks a little like this:
```html
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link href="link/to/a/css/file" rel="stylesheet" type="text/css">
<script src="link/to/an/external/script.js" type="text/javascript"></script>
<script type="text/javascript">
console.log('this is an inline script')
</script>
</head>
<body class="body">
<div id="extension-contents">
...
</div>
<script src="another/js/file.js" type="text/javascript" integrity="this-is-a-sha256-hash" crossorigin="anonymous"></script></body>
</html>
```
Ideally, our chrome extension will insert this html into the webpage at a given point (when they visit a particular website, for example). We do this by appending an element to the DOM of the webpage and setting the "innerHTML" property of that element to the source of our html file. However, none of the javascript that is referenced within the html is being evaluated.
I've done some research and now understand that inserted inline javascript will not be evaluated when part of an element's innerHTML attribute, but what I don't understand is a good, alternative way of keeping the javascript functionality of our assets. I've tried executing the relevant scripts as content scripts or inserting them with chrome.scripting but because content-scripts run in an isolated environment the javascript does not modifying the relevant assets in the inserted html file.
Has anyone encountered an issue like this before?