Page MenuHomePhabricator

returnto and returntoquery in login/signup links doesn't get updated on pushState or popstate
Open, MediumPublic

Description

VisualEditor uses pushState to add veaction=edit to the URL when you click the VE edit tab, without causing a true reload. However, this does not cause a true reload. Similarly, when you click Read, the same happens to go back to read mode.

Unfortunately, this does not update the returnto and returntoquery in the login and signup links. So if you click the tab for VE, then go to login and signup in the top right, you will no longer be in VE when you get back.

VE could make a custom solution for this, but a general method might be nice.

It's possible to listen to user-initiated navigation (e.g. back/forward) with the popstate event. That could solve the problem for back and forward.

However, that doesn't tell you about pushState. So perhaps there should be a mw.pushState that updates these links, then calls the underlying browser method.

Details

Reference
bz62355

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:07 AM
bzimport set Reference to bz62355.
bzimport added a subscriber: Unknown Object (MLST).
matmarex set Security to None.
matmarex removed a subscriber: Unknown Object (MLST).

I have a feeling that we might need to support extensions doing things when a mw.pushState is called...

<Krinkle> [15:50:38] Krenair: Sounds like a good reason to have our page managed by a composition of embedded data-bound dom-based template objects. This'd be trivial there.
<Krinkle> [15:50:52] Krenair: But that's still a year or so away, with neccecary pushback..