Page MenuHomePhabricator

hCaptcha VisualEditor: Don't render or load hCaptcha if hCaptcha is not yet enabled for that mode
Closed, ResolvedPublic

Description

Summary

We should ensure that the ConfirmEdit (CAPTCHA extension) hCaptcha integration in VisualEditor is not loaded unless it is enabled in that interface

Background

  • We have added support for loading and rendering hCaptcha in VisualEditor
    • This support does not include execution yet and so we have decided to wait till later to enable support in those interfaces
  • However, the VisualEditor integration code is loaded when it detected that for a "generic edit" hCaptcha will be needed
    • When the VisualEditor edit is made, we are correctly not requiring hCaptcha to be filled out. However, the determination on whether to load the interface is made not during the context of a VisualEditor edit and so returns that hCaptcha is required (as it is for a generic wikitext edit)
    • This should be changed so that we can indicate that the VisualEditor integration should not be enabled
      • This is likely through a temporary configuration value that indicates whether the VisualEditor on-load integration should be used

Acceptance criteria

Event Timeline

Change #1204670 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/ConfirmEdit@master] VisualEditor hCaptcha: Add config to disable onload handling

https://gerrit.wikimedia.org/r/1204670

Change #1204670 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] VisualEditor hCaptcha: Add config to disable onload handling

https://gerrit.wikimedia.org/r/1204670

Change #1204855 had a related patch set uploaded (by Kosta Harlan; author: Dreamy Jazz):

[mediawiki/extensions/ConfirmEdit@wmf/1.46.0-wmf.2] VisualEditor hCaptcha: Add config to disable onload handling

https://gerrit.wikimedia.org/r/1204855

Change #1204855 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@wmf/1.46.0-wmf.2] VisualEditor hCaptcha: Add config to disable onload handling

https://gerrit.wikimedia.org/r/1204855

Mentioned in SAL (#wikimedia-operations) [2025-11-13T17:16:48Z] <dreamyjazz@deploy2002> Started scap sync-world: Backport for [[gerrit:1204927|MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling (T405595)]], [[gerrit:1204855|VisualEditor hCaptcha: Add config to disable onload handling (T409962)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-13T17:18:50Z] <dreamyjazz@deploy2002> dreamyjazz, kharlan: Backport for [[gerrit:1204927|MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling (T405595)]], [[gerrit:1204855|VisualEditor hCaptcha: Add config to disable onload handling (T409962)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-13T17:25:36Z] <dreamyjazz@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204927|MakeGlobalVariablesScriptHookHandler: Fix hCaptcha site key handling (T405595)]], [[gerrit:1204855|VisualEditor hCaptcha: Add config to disable onload handling (T409962)]] (duration: 08m 48s)