Bug 263635 - window.history.replaceState('', '', '') has no effect in Safari on macOS
Summary: window.history.replaceState('', '', '') has no effect in Safari on macOS
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: History (show other bugs)
Version: Safari 16
Hardware: All All
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-24 23:50 PDT by harnoor1994
Modified: 2023-11-01 22:12 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 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