3rd party script blocked by CORS #193
Unanswered
AloisSeckar
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @AloisSeckar This is due to You can get around this issue by doing scripts: {
globals: {
myScript: ['https://app.termly.io/resource-blocker/bbc9f62b-96e1-4064-bea5-e604bb669e55?autoBlock=on', {
trigger: 'onNuxtReady',
crossorigin: false,
}],
},
}, You can read more about this behaviour here: https://unhead.unjs.io/usage/composables/use-script#referrerpolicy-and-crossorigin Let me know if you have any questions or feedback around this 🙂 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to call external script of Termly cookie consent service via Nuxt Scripts.
This is what I have in my
nuxt.config.ts
:However, the call gets blocked due to CORS:
![image](https://private-user-images.githubusercontent.com/7399922/355747939-d60dd8ab-472b-49e8-bb16-643d1db3e41d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NDY5NDYsIm5iZiI6MTczOTY0NjY0NiwicGF0aCI6Ii83Mzk5OTIyLzM1NTc0NzkzOS1kNjBkZDhhYi00NzJiLTQ5ZTgtYmIxNi02NDNkMWRiM2U0MWQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMTkxMDQ2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDVhYTVmNDg1NjFkZTYxNTk1ODA3OTgxNDNkZjNkOTdlZjI3ZjU3MmVjNWY2ODdhMzk3NTVkYzIyYzYxMmNhNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.J_nrj1E-mLt_o2PRGM9irg0AsNv3QMq4b5z1wef49SQ)
When I have script referenced from
useHead
, it worked with no issues:I am still getting confused with CORS stuff in general. Is there some setting, I need to set up for Nuxt Script module or for Nuxt in general to get this working? Or is it because the target domain refuses my requests due to something I cannot quite affect?
Beta Was this translation helpful? Give feedback.
All reactions