This fixes a bug where the script tag was being injected via innerHTML, which does not execute the script. I have verified the bug is occurring for me in Chrome 123.
I've worked around this by creating a new script tag and programatically copying over the attributes as well as the textContent, effectively cloning the tag. I think this should keep the behaviour consistent with the existing (desired) behaviour.
This fixes a bug where the script tag was being injected via innerHTML, which does not execute the script. I have verified the bug is occurring for me in Chrome 123.
I've worked around this by creating a new script tag and programatically copying over the attributes as well as the textContent, effectively cloning the tag. I think this should keep the behaviour consistent with the existing (desired) behaviour.