<!DOCTYPE html>
<meta charset="utf-8">
<title>This will be in an iframe</title>

<script>
window.name = "iframe";
</script>

<body onbeforeunload="return { toString: parent.postMessage.bind(parent, 'PASS', '*') };">

<!-- window.open() uses the entry settings object to determine how the URL will be parsed -->
<button onclick="var w = window.open('open-window.html'); w.onload = () => { parent.onWindowLoaded(w.document.URL); };">This will be clicked</button>
