Puoi controllarlo indirettamente... verificando se esiste una finestra "madre"

if (!opener) {
alert("errore")
location.href="pagina.htm"
}

ciao