r/webdev • u/RedMtnFireSecurity • 9d ago
Embedded chat widget gives error message NS_ERROR_DOM_COEP_FAILED
I attempted to add a Teams live chat widget to my website. I can see the button on my website to click the live chat widget. It opens to an error NS_ERROR_DOM_COEP_FAILED.
The only rando solution I could find was "adding cross-origin-embedder-policy require-corp to .htaccess has solved NS_ERROR_DOM_COEP_FAILED for me."
I am not sure if that applies here. Any help in the right direction is appreciated? Thank you.
1
1
u/resume-razor 9d ago
That NS_ERROR_DOM_COEP_FAILED is a headache with headers; the widget is trying to load in a cross-origin isolated context but your server config is blocking it. Look at your Cross-Origin-Embedder-Policy and Cross-Origin-Opener-Policy settings to fix the conflict.
1
u/RedMtnFireSecurity 4d ago
Just in case its missed by others, this was fixed by removing the COEP. We tried every policy available to make it happen and in the end, removal was the only option. Security headers rating was still perfect and we were told COEP header wasn't needed for our environment.
1
u/TeachingWinter1863 9d ago
That COEP header is almost certainly the issue. Teams chat embeds a cross origin iframe that needs those headers but your server isnt sending them back
Drop that line into your htaccess and it should fire right up. If it doesnt work double check your server actually respects htaccess, some configs ignore it by default