Pregunta

My website depends on popups. Up until now I've been using window.opener.location.reload() to refresh the parent window, but all of a sudden my users are reporting that popups are not closing. Also, calling window.close() causes a "The webpage you are viewing is trying to close the tab" warning.

I've managed to reproduce this issue in Windows 8.1 Pro Preview running IE 11.0.9431.228, but the problem does not occur in Windows 8.1 Enterprise Evaluation and IE 11.0.9600.16438.

Has anyone else experienced this issue? Why would window.opener not be set? All popups are opened with window.open.

¿Fue útil?

Solución

I found a partial "solution". You can get the parent window if you give it a name first (e.g. window.name='mainwin'), then you can access it via:

if(!window.opener) window.opener = window.open('','mainwin');

This lets me refresh the main window, but calling window.close() still causes a "The webpage you are viewing is trying to close the tab" warning.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top