ladybird/Tests/LibWeb/Text/data/iframe-popstate-event.html
2025-03-20 11:50:49 +01:00

12 lines
401 B
HTML

<!DOCTYPE html>
<script>
window.history.pushState({}, '', window.location.href + '#test');
window.addEventListener('popstate', (e) => {
const url = new URL(window.location.href);
const pathWithHash = url.pathname.split('/').pop() + url.hash;
parent.postMessage(`popstate event from iframe new_path=${pathWithHash}`, '*');
});
window.history.back();
</script>