0

I'm trying to add a page to my website that allows users to view all of my social media feeds in one place. All three social media sites that I'm using (Facebook, Instagram and Pinterest) offer widgets that make this process very easy; however, the requirements for where to place these scripts in my codebase causes the inline scripts to not pass my CSP. My CSP is nothing special, I'm just using the code provided in SvelteKit's documentation. 

I was a bit surprised to find that searching around the web doesn't seem to provide much guidance. I've tried many variations to get around this issue for a few days, but can't seem to solve the problem. Has anyone figured out a way to get around this issue? If so, how did you do so? It's worth noting that I don't want these scripts to load in my root file, I only want them to run when someone visits this particular page.

Feel free to ask for any needed clarification, as I'm just a hobbyist and may be lacking in terms of technical processes and terminology.

Any thoughts and/or suggestions would be greatly appreciated!

Thank you for your time and assistance.

jrfii
  • 41
  • 3
  • Are you looking for https://svelte.dev/examples/svelte-head ? – Natumanya Guy Aug 28 '23 at 02:34
  • Thanks for your response, @NatumanyaGuy! No, because nonce="%sveltekit.nonce%" only works in app.html. Because of this, the script still fails CSP. Additionally, there seems to be a problem with this placement, i.e. in svetle:head, as it pertains to the widget. – jrfii Aug 28 '23 at 03:13

0 Answers0