Newer
Older
minerva / Tests / LibWeb / Text / data / iframe-hashchange-event.html
@minerva minerva on 13 Jul 397 bytes Initial commit
<!DOCTYPE html>
<script>
    window.addEventListener('hashchange', (event) => {
        const oldURL = new URL(event.oldURL);
        const newURL = new URL(event.newURL);
        parent.postMessage(`hashchange oldURL.hash=${oldURL.hash} newURL.hash=${newURL.hash}`, "*");
        if (location.hash === "#test")
            location.hash = "#done";
    });

    location.hash = "#test";
</script>