Created attachment 432448 [details] minimal working example Calling history.pushState or history.replaceState in an iframe whose src was changed has no effect. These functions do work correctly when the iframe's src was not changed, or if they are not in an iframe at all. Calling pushState after the iframe loads but before the pushState in the iframe is called seems to fix the issue. To reproduce the issue, unzip the attached zip which contains index.html and embed.html. Open index.html. It will load embed.html into an iframe. Open the console and click 'push history' under 'frame 2 (src change)'. See that history.length does not change. Then click 'push history' under 'frame 1 (no src change)'. See that history.length does change. Replicated on Safari 14.1.1, latest WebKit (r279353), and iOS Safari on iOS 14.6. Firefox and Chrome do not have this issue.
<rdar://problem/80190653>