The resize event occurs when the window is resized.
<p>Resize the browser window to fire the <mark>resize</mark> event.</p>
<p>Window width: <span id="width"></span></p>
<p>Window height: <span id="height"></span></p>
const heightOutput = document.querySelector('#height');
const widthOutput = document.querySelector('#width');
heightOutput.textContent = parent.window.innerHeight;
widthOutput.textContent = parent.window.innerWidth;
parent.window.addEventListener('resize', function() {
heightOutput.textContent = parent.window.innerHeight;
widthOutput.textContent = parent.window.innerWidth;
});