BuilderIO / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.builder.io
MIT License
12.87k stars 426 forks source link

To embed this frame in your document, the response needs to enable the cross-origin embedder policy by specifying the following response header: Cross-Origin-Embedder-Policy: require-corp #255

Open linuxd3v opened 1 year ago

linuxd3v commented 1 year ago

Describe the bug To use atomics - I add these headers to the html responses:

Cross-Origin-Embedder-Policy: credentialless   
Cross-Origin-Opener-Policy: same-origin

However - even without enabling partytown - this already causes some errors with some third party scripts. I'm seeing these errors in the console:

To embed this frame in your document, the response needs to enable the cross-origin embedder policy by specifying the following response header: Cross-Origin-Embedder-Policy: require-corp

These errors happen seemingly when third party scripts try to embed some html docs. Is this a known issue?

Expected behavior no errors in the console

Partytown version 0.7.0

Screenshots image

Paul-Hebert commented 1 year ago

I'm running into a similar issue with embedding iframes (e.g. code sandbox or codepen.)

My impression is that for third party iframes/scripts to work properly, those third parties would need to set CORS headers on their documents. Is that accurate?

I'm searching for solutions but may have to disable these headers for now to fix these embedded iframes.

(By the way, Partytown is awesome! Thanks for the great tool!)

Ins1eme commented 1 year ago

Having the same issue

maplessmann commented 1 year ago

We're also having the same issue

taraskhvyl commented 10 months ago

is there any solution here?

mhevery commented 10 months ago

Yes, atomics are very restrictive, to the point of being almost unusable. I don't think there is a good solution here...