Firefox adds extra back/forward menu history entry on hashchange, which can lead to poor UX when the back button is pressed.
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
Webcompat Priority | ? |
People
(Reporter: twisniewski, Unassigned)
References
()
Details
If a page does something like the following:
document.addEventListener(
"DOMContentLoaded",
() => {
if (!location.hash) location.hash = "/login";
}
);
Firefox will add a history entry for the initial page-load, then a second one for the hash-changed location (both are visible in the back-button in the address bar). Chrome seems to only replace the initial page-load.
Depending on how the page behaves on the initial page-load, this can cause the user to be unable to go back to the previous page in history unless they long-click the back button and manually select to skip the previous site. For instance, this is presently occuring on the Citywide Banks site as seen in https://webcompat.com/issues/68511 (ie, visit example.org, then the bug URL).
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
This seems possibly related to https://bugzilla.mozilla.org/show_bug.cgi?id=1515073
Reporter | ||
Comment 2•4 years ago
|
||
It also seems that these "extra" history entries are being added when history.pushState
is called, where only the hash changes (as noticed on https://www.dreamstime.com/photos-images/google-headquarters.html in https://webcompat.com/issues/67631)
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 3•4 years ago
|
||
Johann, you worked on bug 1515073, maybe you have an idea of what's going on here?
Updated•4 years ago
|
Comment 4•4 years ago
|
||
This will be changed/fixed as part of user interaction work in bug 1645211 .
Updated•4 years ago
|
Description
•