In my test application using Sveltekit, I tried to inject third party scripts to page using
<script> let scriptsData = 'console.log("Some script executed")'; </script><svelte:head> {@html `<script>${scriptsData}</script>` } </svelte:head>
The above code works fine on direct hit of the page but not during manual navigation to the page. The same thing work if I use
<svelte:head> <script>console.log("Some script executed")</script>` </svelte:head>
But I wish to add scripts dynamically per page. I read somewhere that browser for safety reasons will not execute scripts added dynamically. It accepts only sanitised one's.Is there any easy workaround