Page MenuHomePhabricator

Opening an image preview *should* edit the browser "back-button history" but, when trying to close the preview, the back button should be automatically pressed instead
Closed, DuplicatePublic

Description

When you click on a picture on Wikipedia, a preview page is opened (that can be closed by using the "X" button). The issue is that when you hit the browser's "back" button the preview window opens up again. The expected behavior is that the back button should bring you to the page you were browsing before Wikipedia. This is the default behavior adopted on other websites (e.g. Facebook) and it's the behavior that I normally would expect.

Since this issue has been bugging me, I am starting to get used to *not* use the preview at all (by opening pictures in new tabs), so I'm reporting this because I don't want this useful feature to backfire and become an annoying feature.

Event Timeline

Or, you could just simulate the back button when hitting the "X" button (or the Esc key). I think this is what Facebook actually does. I think it would also be easier to implement.

Kind of. However note that the information published in T64266 seems to be outdated: it's said that Facebook nukes the history entries when exiting the lightbox, however this doesn't seem to be the case anymore.

Right now, Facebook just simulates pressing the back button (so, if you hit the "forward" button after closing the lightbox, you will open it again). I think this behavior is reasonable, and I think Mediawiki could implement it with very little modification over the current behavior.

So, my report should actually be renamed to: «Opening an image preview *should* edit the browser "back-button history" but, when trying to close the preview, the back button should be automatically pressed instead», and that is not a duplicate (since T64266 suggests nuking history entries, and T68217 suggests not updating the URL, both of these things are not what this report is about).

wil93 renamed this task from Opening an image preview shouldn't edit the browser "back-button history" to Opening an image preview *should* edit the browser "back-button history" but, when trying to close the preview, the back button should be automatically pressed instead.May 1 2016, 2:22 PM

This is a slight variation on T64266#667336 E. I would still merge the task.

That task is blocked on lack of consensus; you can find a user script there for implementing a somewhat similar behavior.

Jdlrobson subscribed.

Note, using the mediawiki.router module may help with this.