<script>
var haveCalledDone = false;
window.addEventListener('beforeunload', function() { 
    if (!haveCalledDone) {
        haveCalledDone = true;
        opener.done();
    }
}, false);
</script>
<iframe sandbox="allow-scripts allow-top-navigation"
        src="close-top.html">
</iframe>
