// Check that an opener exists and is not closed
if (window.opener && !window.opener.closed) {
window.opener.location.href = "https://www.mozilla.org";
}Window: closed property / notebook
Window: closed property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
let popupWindow = null;
function refreshPopupWindow() {
if (popupWindow && !popupWindow.closed) {
// popupWindow is open, refresh it
popupWindow.location.reload(true);
} else {
// Open a new popup window
popupWindow = window.open("popup.html", "dataWindow");
}
}