javascript - Why is window.opener undefined in this specific version of WindowsIE? - Stack Overflow

My website depends on popups. Up until now I've been using window.opener.location.reload() to refr

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.

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.

Share Improve this question edited Jun 3, 2014 at 18:33 mpen asked Jun 3, 2014 at 17:49 mpenmpen 284k281 gold badges892 silver badges1.3k bronze badges 4
  • 1 same urls, same domains, same security zones? – Comfortably Numb Commented Jun 3, 2014 at 17:55
  • Could be something with IE's "trusted sites" or "Protected Mode". Have a look here to possibly figure out a workaround: msdn.microsoft./en-us/library/ms533723%28VS.85%29.aspx – Arbel Commented Jun 3, 2014 at 18:01
  • 1 @YuriyGalanter I tried resetting the all the security settings and also cranking them all the way down. Still happens. Tried disabling Protected Mode as well. Still happens. – mpen Commented Jun 3, 2014 at 18:16
  • @YuriyGalanter And yes, same URLs and domain. Like I said, it works in other browsers, and even the same OS and major version of IE; only thing I can see that's different is the minor versions. And the fact that one is running under VirtualBox and the other under Remote Desktop, but I can't see how that changes anything. – mpen Commented Jun 3, 2014 at 18:25
Add a ment  | 

1 Answer 1

Reset to default 7

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744387761a4571752.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信