Destiner / astro-analytics

Astro components for site analytics
MIT License
110 stars 11 forks source link

This script link along with others need CORS attributes #2

Open aFuzzyBear opened 2 years ago

aFuzzyBear commented 2 years ago

https://github.com/Destiner/astro-analytics/blob/86756864acf378de9e0062ffebbf51006e85ca1f/src/Fathom.astro#L8

Hey its me again, I just wanted to say if you add the crossorigin="use-credentials || anonymous" to the script tags it would allow that to pass through without having any CORS issues, else they would end up running away with you,

Destiner commented 2 years ago

@aFuzzyBear thanks for suggestion. Do you mind to clarify? I don't have a lot of knowledge with crossorigin, but adding it makes the script failing to load, at least on localhost.

aFuzzyBear commented 2 years ago

Hi @Destiner,

The CORS issue is more of a explicit way of telling the browser what to send with that request, if the request was made from the same origin as the request is coming from or if it was made my an external third party script.

This is a pitfall of problems, I havent looked into which cors tag that you need to apply for each of these scripts that you have, but I would recommend checking it out,