Skip to content

History entry state (history & appHistory) and error documents #7106

@jakearchibald

Description

@jakearchibald

I'm trying to spec how error documents work and ran into this:

  1. Go to a page that doesn't work offline.
  2. Run history.replaceState({ foo: 'bar' }, '', '').
  3. Go offline & refresh to get an error page.
  4. 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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions