Bug 209753 - `pushState` and `back` trigger page reloading when called in iframe
Summary: `pushState` and `back` trigger page reloading when called in iframe
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: History (show other bugs)
Version: Safari 13
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-30 10:48 PDT by Ivan Nedzvetskiy
Modified: 2020-03-30 13:18 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Nedzvetskiy 2020-03-30 10:48:31 PDT
Reproducible script that can be ran on https://test.dev1.hsstore.ru/safari/

What happened:
When an `iframe` calls `window.history.pushState` and then `window.history.back`, the parent window's reloading. 
It happens only if we create iframe on the parent window and remove it before creating app iframe with history manipulation.


Expected behavior:
Fire event `popstate` without reload.


Steps to reproduce:
1. Create iframe, add to DOM on parent page
2. Remove iframe from DOM  on parent page
3. Create another iframe, load some app in it on parent page
4. In an app iframe, call `window.history.pushState(...)`
5. In an app iframe, call `window.history.back(...)`
6. Got reload instead of expected popstate event

Demo:
1. Go https://test.dev1.hsstore.ru/safari/
2. Click pushState
3. Click back
4. Got reload
Comment 1 Radar WebKit Bug Importer 2020-03-30 13:18:09 PDT
<rdar://problem/61069867>