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
- The dialog is dismissed and I can read the article Naugadh
- The dialog is dismissed and I am ejected from the mobile site.
- Chromium v68.0.3440.75
- Ubuntu v18.04 64b
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
Do not worry about browsers that do not support the history api.