简体   繁体   English

window.open在IE8保护模式下返回null

[英]window.open returns null in IE8 Protected Mode

I am trying to catch the return value of window.open(), but it is returning null/undefined. 我正在尝试捕获window.open()的返回值,但它返回的是null / undefined。 This happens when IE8 Protected mode is turned ON. IE8保护模式打开时会发生这种情况。 Is there any altenative to get the window.open() returned object without disabling the protected Mode in IE8? 在不禁用IE8中的保护模式的情况下,是否有其他方法可以获取window.open()返回的对象?

You're trying to perform one of the things Protected Mode is specifically designed to stop... 您正在尝试执行保护模式专门用于阻止...的其中一项操作...

From Microsoft -- open method : 从Microsoft- 打开方法

Opening a new window from an application (other than the Internet Explorer process) may result in a null return value. 从应用程序(不是Internet Explorer进程)打开新窗口可能会导致返回空值。 This restriction occurs because Internet Explorer runs in protected mode, by default. 出现此限制的原因是,默认情况下,Internet Explorer在保护模式下运行。 One facet of protected mode prevents applications from having privileged access to Internet Explorer when that access spans process boundaries. 受保护模式的一个方面是,当应用程序跨越进程边界时,可以阻止应用程序对Internet Explorer进行特权访问。 Opening a new window by using this method generates a new process. 通过使用此方法打开一个新窗口将生成一个新过程。 For more information about protected mode, see Understanding and Working in Protected Mode Internet Explorer . 有关保护模式的更多信息,请参见了解和在保护模式下工作Internet Explorer This commonly occurs for applications that host the WebBrowser control. 对于托管WebBrowser控件的应用程序,通常会发生这种情况。

If you're looking for a way to perform similar, then we'll need to know exactly what your doing and how your attempting to use window.open. 如果您正在寻找一种执行类似方法的方法,那么我们将需要确切地知道您在做什么以及您如何尝试使用window.open。

Most likely though, that would be a programming-specific problem, which would be off-topic for SU. 不过,最有可能的是,这是特定于编程的问题,对于SU而言,这是不合时宜的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM