1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 21:07:36 +00:00

LibWeb: Update session history when History entry is pushed/replaced

With this change `shared_history_push_replace_state()` starts to
actually add/replace session history entry.
This commit is contained in:
Aliaksandr Kalenik 2023-09-23 23:04:24 +02:00 committed by Andrew Kaster
parent 699ead0939
commit 7cdbd59e92
6 changed files with 55 additions and 13 deletions

View file

@ -0,0 +1,20 @@
<script src="../include.js"></script>
<script>
try {
const initialHistoryLength = window.history.length;
history.pushState({}, "hello", "history-pushstate-iframe.html#hello");
if (window.self !== window.top) {
parent.postMessage(
"history object length has changed by " +
(window.history.length - initialHistoryLength),
"*"
);
} else {
test(() => {});
}
} catch (e) {
if (window.self !== window.top) parent.postMessage("ERROR:" + e, "*");
}
</script>