history state incorrect on pageshow after another page was visited
Categories
(Core :: DOM: Navigation, defect, P3)
Tracking
()
People
(Reporter: jackdesbwa, Unassigned)
Details
Attachments
(1 file)
(deleted),
text/html
|
Details |
Probable defect: The history state looks incorrect when the pageshow
event is fired after another page was visited
Observed on Firefox 87 on Linux.
Not tested on other platforms.
The attached file is a page with a simple script which show in the console the state on popstate
and pageshow
, and has a form to add state.
To reproduce:
- Add a few states with the form
Expected: States are added [OK]
Console:
add 1
add 2
add 3
add 4
add 5
add 6
-
Visit another page
Expected: the other page/website is displayed [OK] -
Come back on an intermediary state (right click on back button, and select for example the state 2)
Expected: State 2 is restored [KO]
Observed: State 6 (i.e. last displayed) is restored
Console:
pageshow 6
Note: it looks like it is the report to the JS code that is not working, because hitting the forward button gives the expected state.
Console:
popstate 3
It looks like a bug. If not, what is the correct way to get the state in this case?
Comment 1•4 years ago
|
||
@ Olli, we have different unexpected behaviors with bfcache and without bfcache:
- This bug: When we restore from bfcache, we don't fire popstate.
- Holding down Back button, the Back button's page titles are wrong (Fission no-bfcache, SHIP only?). I filed bug 1706167 for this variant.
Updated•4 years ago
|
Description
•