Open Bug 1580479 Opened 6 years ago Updated 3 years ago

bfcache loads don't consider pushState()

Categories

(Core :: DOM: Navigation, defect, P3)

defect

Tracking

()

People

(Reporter: annevk, Unassigned)

Details

If you have a document such as

data:text/html,<button onclick="window.n = window.n || 0; history.pushState({id: ++n}, '' + n); console.log('n', n);">clicky</button><script>window.onpopstate=function(evt) { console.log(evt.state); }</script>

and click clicky a couple times and then navigate elsewhere using window.location or some such and then hold the back button to jumb back to an arbitrary point, you get back to the clicky document, but there's no popstate event telling you where in the clicky document you are so the clicky document cannot restore the correct state.

(This might not be specified well. This is also a concern for scrollRestoration, whenever we implement that.)

Flags: needinfo?(peterv)
Priority: -- → P3

Works in Safari, but doesn't seem to work in Chrome?

Flags: needinfo?(peterv)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.