t49tran / react-google-recaptcha-v3

Google Recaptcha V3 integration for React
MIT License
427 stars 91 forks source link

iOS Safari Support #124

Open fatihyildizhan opened 2 years ago

fatihyildizhan commented 2 years ago

Hi, I just started using recaptcha v3 with nextjs. It is not working on iOS Safari. Does recaptcha v3 support it? I couldn't debug it. What could be the problem? Thank you.

Guvidaletti commented 1 year ago

Same problem here with React and Typescript. On both (Chrome iOS and Safari iOS) the Recaptcha logo doesn't appear and the useGoogleReCaptcha hook returns undefined. Nothing on console.

ValentinGurkov commented 1 year ago

Same here, does not run on iOS 15. Seems to work on 16.

ValentinGurkov commented 1 year ago

For us, it turned out to be related to the content security policy. Safari 15 was blocking the request due to the script-src not allowing this domain. Because of this the script does not trigger the onload event, and useRecaptcha will remain undefined. Check if you allow www.gstatic.com.

With Browserstack, the Chrome DevTools did not log this error but the Safari Web Inspector did.

agatsumayuki commented 1 year ago

We are developing in react with the following packages. As you have pointed out, we are experiencing a bug on IOS Safari. the error message we are getting with reCAPTCHA v3 is

{
  "success": false,.
  "error-codes": [
    "browser-error"
  ]
}

It is possible that the execute function is not being executed within react-google-recaptcha-v3. Is there any progress in fixing this?


packages

    "node": "18.12.1",
    "yarn": "1.22.19"
    "typescript": "^4.9.4",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",