Google recaptcha v3- working properly on my website, But I'm getting console error net::ERR_BLOCKED_BY_RESPONSE 200 How can I resolve this error ?
Thanks
I am receiving the same error intermittently in my console for the past few days. Even though the Recaptcha script is on all pages of my website, only some pages will display these console errors. Looking deeper it in the Network tab of Chrome's DevTools, it has this message:
"NOT-SET cross-origin-embedder-policy 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"
Further Information Provided by DevTools:
"Because your site has the Cross-Origin Embedder Policy (COEP) enabled, each embedded iframe must also specify this policy. This behavior protects private data from being exposed to untrusted third party sites.
To solve this, add the following to the embedded frame’s HTML response header:
Cross-Origin-Embedder-Policy: require-corpAffected Resources:
Blocked Resource > Request: webworker.js?hl=en&v=...
Parent Frame: www.google.com/recaptcha/api2/anchor?ar=1...
Learn more at https://web.dev/coop-coep/"
This seems to be a problem created by Google for Google. We can not modify the parent frame (Google's) response header.
I did further testing in different browsers and this error seems to only appear on Chromium-based browsers, i.e. Chrome and Edge. I have also submitted a new issue with the chromium project https://bugs.chromium.org/p/chromium/issues/detail?id=1259354
UPDATE The chromium browser team found the solution.
Recaptcha team is rolling the COEP enforcement rollout back to zero. The result should be COEP report-only headers across the board, which should fix this problem.
Root cause (as I understand) was that COEP enforcement status was not sync'd between the 'anchor' document and the 'webworker.js' resource. Source
When I set the following header this issue goes away:
X-Frame-Options: "SAMEORIGIN"
You can test this quickly in your .htaccess with:
Header append X-Frame-Options: "SAMEORIGIN"
Make sure you have the 'headers' module enabled in apache!