I'm trying to spec how error documents work and ran into this:
- Go to a page that doesn't work offline.
- Run
history.replaceState({ foo: 'bar' }, '', '').
- Go offline & refresh to get an error page.
- Go online & refresh to get the original page.
What is history.state?
Chrome & Safari: null.
Firefox: { foo: 'bar' }.
Firefox's behaviour seems to make the most sense here. A temporary error shouldn't result in the loss of history state.
However, in #6213 (comment) we saw that redirects during a reload do clear history state. I'm not sure if appHistory wants to do the same (cc @domenic), but it definitely needs be cleared on cross origin redirects.
Error pages are a different origin, but does it make sense to carve out some kind of exception in the spec to avoid clearing history state in this case?