Bug 263635

Summary: window.history.replaceState('', '', '') has no effect in Safari on macOS
Product: WebKit Reporter: harnoor1994
Component: HistoryAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Major CC: ahmad.saleem792, mike, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: All   
OS: All   

Description harnoor1994 2023-10-24 23:50:03 PDT
window.history.replaceState('', '', '') behave differently on Safari on MacOS.

It is supposed to update the address bar to the default URL (before the hash parameter). But it has no effect on Safari on MacOS.
Comment 1 Ahmad Saleem 2023-10-25 16:13:19 PDT
Can you share test case to reproduce the issue? Plus whether it is reproducible on latest Safari Technology Preview 181?
Comment 2 Radar WebKit Bug Importer 2023-10-31 23:50:15 PDT
<rdar://problem/117782346>
Comment 3 harnoor1994 2023-11-01 10:33:37 PDT
Yes it is reproducible on Safari Technology Preview 181. I am working on test cases. Thanks!
Comment 4 sideshowbarker 2023-11-01 22:12:25 PDT
Ideally what would be the most help is a WPT test that would be runnable under the WPT test harness.

You can find the existing such tests at https://github.com/web-platform-tests/wpt/tree/master/html/browsers/history/the-history-interface — for example, https://github.com/web-platform-tests/wpt/blob/master/html/browsers/history/the-history-interface/history_replacestate.html

And you can run those tests directly in any browser by going, for example, to http://wpt.live/html/browsers/history/the-history-interface/history_replacestate.html

So you might be able to just add a `window.history.replaceState('', '', '')` test (with an assert_equals or some other kind of assert_*) directly to a copy of the existing https://github.com/web-platform-tests/wpt/blob/master/html/browsers/history/the-history-interface/history_replacestate.html source