Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

history.state when going back to bfcached page #6652

Closed
jakearchibald opened this issue May 5, 2021 · 2 comments · Fixed by #6315
Closed

history.state when going back to bfcached page #6652

jakearchibald opened this issue May 5, 2021 · 2 comments · Fixed by #6315
Assignees

Comments

@jakearchibald
Copy link
Contributor

Unless I'm reading things wrong, https://html.spec.whatwg.org/multipage/browsing-the-web.html#traverse-the-history step 14 recreates the state object.

Test:

  1. Go to https://example.com/.
  2. history.replaceState({foo: 'bar'}, '', '');.
  3. window.tmp = history.state;.
  4. Navigate to https://jakearchibald.com.
  5. Press back.
  6. window.tmp === history.state.

According to the spec, I'd expect the above to be false, but it's true in Firefox, Safari, and Chrome (with bfcache forced).

Browser behaviour seems reasonable to me, so I'll fix it in #6315.

@jakearchibald
Copy link
Contributor Author

@domenic - I imagine you'll want appHistory to behave in the same way?

@domenic
Copy link
Member

domenic commented May 5, 2021

Well in app history every time you call getState() you get a fresh deserialized copy, so I think this problem will be avoided.

domenic added a commit to web-platform-tests/wpt that referenced this issue Oct 10, 2022
domenic added a commit to web-platform-tests/wpt that referenced this issue Oct 10, 2022
Per whatwg/html#6652, it must not get serialized and deserialized.
domenic added a commit to web-platform-tests/wpt that referenced this issue Oct 11, 2022
Per whatwg/html#6652, it must not get serialized and deserialized.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 21, 2022
…, a=testonly

Automatic update from web-platform-tests
history.state during a bfcache traversal

Per whatwg/html#6652, it must not get serialized and deserialized.
--

wpt-commits: 7d60342ce41a95f4db1e57dd324917a9bc8bf730
wpt-pr: 36368
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Oct 26, 2022
…, a=testonly

Automatic update from web-platform-tests
history.state during a bfcache traversal

Per whatwg/html#6652, it must not get serialized and deserialized.
--

wpt-commits: 7d60342ce41a95f4db1e57dd324917a9bc8bf730
wpt-pr: 36368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants