whitecube / laravel-cookie-consent

Register, configure and ask for cookies consent in a EU-compliant way
MIT License
312 stars 37 forks source link

Fix injected scripts not executing #38

Closed CNimmo16 closed 5 months ago

CNimmo16 commented 5 months ago

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.