This is a longstanding issue. It applies to issues, editor and talk overlays. It is impossible to read the article if you follow a url which contains a hash fragment.
Steps to Reproduce
- open fresh browser tab
- Visit the all issue link in the new OR old treatment: https://readers-web-master.wmflabs.org/wiki/Naugadh#/issues/all
- Close the issue dialog
Expected Results
- The dialog is dismissed and I can read the article Naugadh
Actual Results
- The dialog is dismissed and I am ejected from the mobile site.
Environments Observed
- readers-web-master
Browser Version
- Chromium v68.0.3440.75
OS Version
- Ubuntu v18.04 64b
Device Model
- Desktop
Device Language
- English
developer notes
Exiting an overlay relies on the back button. A solution will thus need to detect that the user has entered the mobile experience in the hash fragment state. The OverlayManager when initialising will need to be able to detect that it started with a hash fragment beginning with "/". When this is the case, using history replaceState and then a pushState call we should inject a new item without the hash fragment state before the current before opening the overlay.
One downside of this approach is refreshing the page will impact back behaviour as it will insert an unnecessary item in history.
Ideally, we would be able to detect that the history queue is empty or the previous url has a different domain but detecting the previous page in history seems problematic. See
https://stackoverflow.com/questions/3588315/how-to-check-if-the-user-can-go-back-in-browser-history-or-not#3588420
Do not worry about browsers that do not support the history api.