VisualEditor: onbeforeunload throws Uncaught TypeError when leaving page from "Read" mode
Closed, ResolvedPublic


Steps to reproduce:

  • Go to a page
  • Switch to Edit mode
  • Switch to Read mode
  • Go to a different page (e.g. "View history" or "Main Page")

Uncaught TypeError: Cannot call method 'getModel' of null

Version: unspecified
Severity: normal

bzimport added a project: VisualEditor-MediaWiki.Via ConduitNov 22 2014, 12:48 AM
bzimport set Reference to bz38902.
Krinkle created this task.Via LegacyAug 1 2012, 1:15 AM
Jdforrester-WMF added a comment.Via ConduitAug 1 2012, 1:44 AM

Either onbeforeunload() needs logic that we might have already torn down the surface and not complain if that's happened, or we need to not clean up after switching from the Edit tab to the Read tab. :-)

Krinkle added a comment.Via ConduitAug 1 2012, 6:33 AM


Uncaught RangeError: Maximum call stack size exceeded
> jQuery.extend.proxy.proxy
> jQuery.extend.proxy.proxy
> [..]
> jQuery.extend.proxy.proxy
> jQuery.extend.proxy.proxy

TrevorParscal added a comment.Via ConduitAug 22 2012, 9:44 PM

Resolved in I13a2f02d256937b7da3aca3ad3c3404bd8f31244 by checking that the surface object was still around before using it.

Jdforrester-WMF added a comment.Via ConduitJun 28 2013, 3:02 AM

Not fixed - that fixes a type error for undefined, not a range error.

Jdforrester-WMF added a comment.Via ConduitFeb 18 2014, 7:00 PM

Fixed a long time ago (September?). Closing.

Add Comment