chromium/third_party/blink/web_tests/fast/dom/Window/resources/report-size-and-close.html

<body onload="loaded()">
<script>
function loaded() {
    var msg = { "width": window.outerWidth, "height": window.outerHeight };
    if (window.dialogArguments != undefined) {
        window.returnValue = msg;
        window.close();
    } else
        window.opener.postMessage(msg, '*');
}
</script>
</body>