serenity/Tests/LibWeb/Text/data/iframe-hashchange-event.html
2024-04-15 01:02:51 -07:00

13 lines
397 B
HTML

<!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>