Page MenuHomePhabricator

The onBeforeUnloadHandler isn't getting set(?) when switching from VE to NWE
Closed, ResolvedPublic1 Estimated Story Points

Description

  • Load VE on a page
  • Switch to NWE
  • Make some changes
  • Click away (e.g. on the sidebar)

Expected outcome: OOUI message dialgo, "Are you sure?" / "Are you sure you want to leave editing mode without saving first?"

Worse but not-terrible outcome: Browser alert, "Do you want to leave this site?" / "Changes that you made may not be saved."

Actual outcome: No warning, browser follows link.

Switching to read mode by clicking "Read" from a changed VE, NWE, or NWE-switched-from-VE works.
Navigating away by click "Main page" from a changed VE or NWE does the latter.

Event Timeline

Fun discovery! It's actually getting too set, causing an infinite loop which the browser sensibly just aborts and walks away from.

Change 341821 had a related patch set uploaded (by DLynch):
[mediawiki/extensions/VisualEditor] Switching modes created an infinite loop onBeforeUnload

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

The onBeforeUnloadHandler is getting superset when switching from VE to NWE

Change 341821 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor] Switching modes created an infinite loop onBeforeUnload

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