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:
parent
699ead0939
commit
7cdbd59e92
6 changed files with 55 additions and 13 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue