Newer
Older
minerva / Tests / LibWeb / Text / data / iframe-popstate-event.html
@minerva minerva on 13 Jul 385 bytes Initial commit
<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>