I am using SharedArrayBuffer for some of functionalities in one of the webapp. On Chrome version 92 I have enabled cross origin isolation as per instructions here and added following headers to root page and wasm
files.
Cross-Origin-Resource-Policy: cross-origin
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
After that wasm
files were loaded successfully.
But now I am not able to add ReCaptchaV2. The first request to fetch main script is successful https://www.google.com/recaptcha/api.js...
but the subsequent iframe loading of https://www.google.com/recaptcha/api2/anchor...
url is being blocked by Chrome.(Reason: This resource needs Cross-Origin-Resource-Policy: same-site/cross-origin header
)
One way to avoid this issue for a while might be to get a token from Chrome to allow usage of SharedBufferArray
by getting a Trial Token and using that. Ref https://developer.chrome.com/blog/enabling-shared-array-buffer/#origin-trial. But this might not be a scalable thing to do as I have several origins to take care of.
Is there any other way to use ReCaptcha with Cross Origin Isolation (COEP Headers) ?