Page MenuHomePhabricator

Disable back button when hCaptcha is loading on mobile source editor
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

What is the problem?

On the preview page of the mobile source editor, while hCaptcha is loading after you click Publish, you can go back to the editor. hCaptcha continues to be loaded in the background leading to the challenge either showing (hidden until you go back to the preview page) or the edit being submitted unexpectedly.

The back button should be disabled while hCaptcha is loading. This is what we do in the mobile VisualEditor.

Steps to reproduce problem
  1. https://test.wikipedia.org/wiki/Special:Random
  2. Switch to mobile view
  3. Open the edit form
  4. Switch to Source Editor (if not already there)
  5. Type something and click the next button
  6. On the preview page, click "Publish" (or "Save")
  7. While the hCaptcha blue spinner is showing click back
Environment

Browser: Chromium 147
Wiki(s): https://test.wikipedia.org MediaWiki 1.46.0-wmf.24 (rMW73b5a57ccafc) 07:05, 27 April 2026. ConfirmEdit 1.6.0 (rECOEd005a6e3305a) 12:08, 23 April 2026.
Editor: MobileFrontend 2.4.1 (d6e518e) 10:37, 13 April 2026.

Event Timeline

Change #1277487 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/extensions/ConfirmEdit@master] hcaptcha: Disable the back button in the MobileFrontend SourceEditor while a captcha is loading

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

The back button should be disabled while hCaptcha is loading. This is what we do in the mobile VisualEditor.

I would note that while the close button is disabled, you can still press "Esc" to exit the dialog.

I wonder if it would be better in case there is an error with hCaptcha to allow the user to exit the dialog even if they pressed save changes?

hector.arroyo changed the task status from In Progress to Stalled.Apr 29 2026, 2:33 PM
hector.arroyo set the point value for this task to 2.
hector.arroyo changed the task status from Stalled to In Progress.EditedMay 7 2026, 8:48 AM

The patch fixing the defect found in the MobileFrontend (T424651: MobileFrontend's source editor allows to click on the back button while the edit is being saved) during the code review for this task has been merged, and is now awaiting QA, but this should not block code review for this task.

Therefore, code review for this task can continue now: unblocking it.

Change #1277487 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] hcaptcha: Disable the back button while MobileFrontend loads a captcha

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