Skip to content

Load recaptcha related files on focus of the form fields.#6

Merged
rhoerr merged 2 commits intomage-os:mainfrom
Bashev:load-recaptcha-on-focus
Feb 27, 2026
Merged

Load recaptcha related files on focus of the form fields.#6
rhoerr merged 2 commits intomage-os:mainfrom
Bashev:load-recaptcha-on-focus

Conversation

@Bashev
Copy link
Contributor

@Bashev Bashev commented Jan 24, 2026

Original PR magento/security-package/pull/334

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)

Fixes magento/security-package#333
Fixes magento/magento2#38303

Manual testing scenarios (*)

Enable reCaptcha (no matter which version) for Newsletter, Contact Form, Review, Registration or ... anything.
Load the page which will contains form for which reCaptcha is enabled (Ex. Contact form /contact)
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).
Click on the first or random field (Ex. Name)
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 (*)

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

@Bashev Bashev requested a review from a team as a code owner January 24, 2026 15:40
@rhoerr
Copy link
Contributor

rhoerr commented Feb 27, 2026

Thanks for submitting this. Just saw it now. We can merge once the trailing spaces are fixed.

@rhoerr rhoerr self-assigned this Feb 27, 2026
Copy link
Contributor

@rhoerr rhoerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@rhoerr rhoerr merged commit a3be300 into mage-os:main Feb 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reCapcha loading reflects to page speed [Performance] Load reCaptcha on focus to input to improve page load times

2 participants