working example here ...
content.innerHTML = html;
var forienScriptText = content.getElementsByTagName('script').innerHTML;
var scr = document.createElement('script');
console.log('Failed to fetch page: ', err);
of course there are several Better Solutions
I presented this solution because
all you need to do is add a few lines of code
to your existing project
kiwis80 said ...
"I'm assuming it's being treated as text only."
your assumption was correct
always use innerHTML as if it were ReadOnly,
never use it to add anything to page
in the above code I broke this rule