Setup Cross-Origin Resource Sharing (CORS)

Is this better to use than CSP if you want to use javascript in posts for example?

I have currently relied to theme components or CSP in order to run js,

Best regards
Olle