security-package icon indicating copy to clipboard operation
security-package copied to clipboard

Load recaptcha related files on focus of the form fields.

Open Bashev opened this issue 6 months ago • 19 comments

Description (*)

reCaptcha remote files will be loaded only if customer (visitor) focus on the fields for the form for which reCaptcha is enabled. This will reduce loaded files and immediately reflects to loading time.

Fixed Issues (if relevant)

  1. Fixes https://github.com/magento/security-package/issues/333
  2. Fixes https://github.com/magento/magento2/issues/38303

Manual testing scenarios (*)

  1. Enable reCaptcha (no matter which version) for Newsletter, Contact Form, Review, Registration or ... anything.
  2. Load the page which will contains form for which reCaptcha is enabled (Ex. Contact form /contact)
  3. ReCaptcha external (gstatic.com) files will not be loaded (you will not see the logo of the recaptcha or loaded files in the network tab of the browser developer inspector).
  4. Click on the first or random field (Ex. Name)
  5. Recaptcha files will be loaded and you will see logo of the repCaptcha somewhere on the page as you are configured in the step 1.

Questions or comments

Contribution checklist (*)

  • [x] Author has signed the Adobe CLA
  • [x] Pull request has a meaningful description of its purpose
  • [x] All commits are accompanied by meaningful commit messages
  • [x] All new or changed code is covered with unit/integration tests (if applicable)
  • [x] All automated tests passed successfully (all builds are green)

Bashev avatar Dec 19 '23 14:12 Bashev