访问window.closed时拒绝权限 [英] Permission Denied when accessing window.closed

查看:95
本文介绍了访问window.closed时拒绝权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好,


我有一些网站的代码,使用''window.open''模拟

模态对话框。我使用window.closed属性来判断

窗口对象是否存在于各个点。这个一直很好,直到最后

一周,当我开始收到javascript''Permission Denied''错误时

我试图访问这个属性。

我怀疑Windows更新导致了这种情况,因为这段代码

在很长一段时间内都没有改变。任何人都可以确认是否有任何Windows更新会导致这种情况吗?也许某些浏览器

安全设置已经改变了,或者其他什么?


这不是一个大问题,因为我已经有了自己的封闭标志检查

因为window.closed在IE5中不可靠,所以我可以完全使用window.closed停止

。我希望能够解释这个错误的突然出现,但是..


谢谢,

Alistair。

Morning All,

I have some code for a website which uses ''window.open'' to simulate
modal dialog boxes. I use the window.closed property to decide if the
window object exists at various points. This has been fine until last
week when I started getting javascript ''Permission Denied'' errors when
I try to access this property.

I suspect that a windows update has caused this somehow, as this code
has not changed for a very long time. Can anyone confirm if there have
been any windows updates that would cause this? Maybe some browser
security settings have subtely changed, or something?

Its not a huge problem, as I already had my own ''closed'' flag to check
as window.closed was not reliable in IE5 anyway, so I may just stop
using window.closed entirely. I would like to be abel to explain the
sudden appearance of the error, though..

Thanks,
Alistair.

推荐答案

我遇到了同样的事情我发现当我删除了一个

最近的windows更新,Internet Explorer的累积安全更新
Windows XP的
(KB918899),问题消失了。当然,这不是我可以提供给客户的选项。


在我的场景中,当我检查window.closed时会抛出错误。

属性,用于定时器间隔循环中的弹出窗口。弹出后,

报告为关闭开启器然后使用弹出窗口中的数据运行一个函数。


玩javascript我发现如果我延迟检查

已关闭的房产约1秒钟,那么封闭的房产报告

正确地说它关闭了。此外,在弹出窗口关闭之前

该属性正确报告该窗口未关闭。


我使用此例程,

if(dialog&&!dialog.closed)dialog.focus();

在很多地方让我的弹出窗口有点像模态对话框

,我很想知道是否有安全设置或其他选项

可用于避免现在已经被拒绝错误,因为它已成为IE中的一个问题6.0.29。


任何见解都将受到赞赏。谢谢,

詹姆斯

al ****************@email.com 写道:
I am encountering the same thing and I found that when I removed a
recent windows update, Cumulative Security Update for Internet Explorer
for Windows XP (KB918899), the issue went away. Of course, that is not
an option I can present to our clients.

In my scenario the error is being thrown when I check the window.closed
property for a pop-up in a timer interval loop. After the pop-up is
reported as closed the opener then runs a function using the data from
the pop-up.

Playing with the javascript I found that if I delayed checking the
closed property for about 1 second then the closed property reported
back correctly that it was closed. Also, before the pop-up was closed
the property correctly reported back that the window was not closed.

I use this routine,
if (dialog && !dialog.closed) dialog.focus();
in many places to make my pop-ups behave somewhat like a modal dialog
and I would love to hear if there is a security setting or other option
available to avoid the Permission Denied error now that it has become
an issue within IE 6.0.29.

Any insights would be appreciated. Thanks,
James

al****************@email.com wrote:

Morning All,


我有一些网站的代码使用''window.open''模拟

模态对话框。我使用window.closed属性来判断

窗口对象是否存在于各个点。这个一直很好,直到最后

一周,当我开始收到javascript''Permission Denied''错误时

我试图访问这个属性。

我怀疑Windows更新导致了这种情况,因为这段代码

在很长一段时间内都没有改变。任何人都可以确认是否有任何Windows更新会导致这种情况吗?也许某些浏览器

安全设置已经改变了,或者其他什么?


这不是一个大问题,因为我已经有了自己的封闭标志检查

因为window.closed在IE5中不可靠,所以我可以完全使用window.closed停止

。我希望能够解释这个错误的突然出现,但是..


谢谢,

Alistair。
Morning All,

I have some code for a website which uses ''window.open'' to simulate
modal dialog boxes. I use the window.closed property to decide if the
window object exists at various points. This has been fine until last
week when I started getting javascript ''Permission Denied'' errors when
I try to access this property.

I suspect that a windows update has caused this somehow, as this code
has not changed for a very long time. Can anyone confirm if there have
been any windows updates that would cause this? Maybe some browser
security settings have subtely changed, or something?

Its not a huge problem, as I already had my own ''closed'' flag to check
as window.closed was not reliable in IE5 anyway, so I may just stop
using window.closed entirely. I would like to be abel to explain the
sudden appearance of the error, though..

Thanks,
Alistair.


James,


感谢您提供的信息 - 如果我删除KB918899,我可以确认

然后问题就消失了。如你所说,尝试建议一个

客户端!我和你描述的几乎一样,除了我有一个封装了窗口对象的对象,并且在该对象上已经有一个

''关闭''标志因为window.closed没有在IE5中正确报告
。我想我可能会停止使用window.closed

而只依靠我自己的旗帜。


谢谢,

Al 。

ja ************ **@gmail.com 写道:
James,

Thanks for that information - I can confirm that if I remove KB918899
then the problem goes away. As you say, try suggesting that to a
client! I do pretty much the same as you describe, except that I have
an object which encapsulates the window object and already have a
''closed'' flag on that object as the window.closed was not being
reported correctly in IE5. I think I may stop using the window.closed
and just rely on my own flag instead.

Thanks,
Al.

ja**************@gmail.com wrote:

我遇到了同样的事情,我发现当我删除了

最近的Windows更新,Internet Explorer的累积安全更新
Windows XP的
(KB918899),问题消失了。当然,这不是我可以提供给客户的选项。


在我的场景中,当我检查window.closed时会抛出错误。

属性,用于定时器间隔循环中的弹出窗口。弹出后,

报告为关闭开启器然后使用弹出窗口中的数据运行一个函数。


玩javascript我发现如果我延迟检查

已关闭的房产约1秒钟,那么封闭的房产报告

正确地说它关闭了。此外,在弹出窗口关闭之前

该属性正确报告该窗口未关闭。


我使用此例程,

if(dialog&&!dialog.closed)dialog.focus();

在很多地方让我的弹出窗口有点像模态对话框

,我很想知道是否有安全设置或其他选项

可用于避免现在已经被拒绝错误,因为它已成为IE中的一个问题6.0.29。


任何见解都将受到赞赏。谢谢,

詹姆斯

al ****************@email.com 写道:

Morning All,


我有一些网站的代码使用''window.open''模拟

模态对话框。我使用window.closed属性来判断

窗口对象是否存在于各个点。这个一直很好,直到最后

一周,当我开始收到javascript''Permission Denied''错误时

我试图访问这个属性。

我怀疑Windows更新导致了这种情况,因为这段代码

在很长一段时间内都没有改变。任何人都可以确认是否有任何Windows更新会导致这种情况吗?也许某些浏览器

安全设置已经改变了,或者其他什么?


这不是一个大问题,因为我已经有了自己的封闭标志检查

因为window.closed在IE5中不可靠,所以我可以完全使用window.closed停止

。我希望能够解释这个错误的突然出现,但是..


谢谢,

Alistair。
Morning All,

I have some code for a website which uses ''window.open'' to simulate
modal dialog boxes. I use the window.closed property to decide if the
window object exists at various points. This has been fine until last
week when I started getting javascript ''Permission Denied'' errors when
I try to access this property.

I suspect that a windows update has caused this somehow, as this code
has not changed for a very long time. Can anyone confirm if there have
been any windows updates that would cause this? Maybe some browser
security settings have subtely changed, or something?

Its not a huge problem, as I already had my own ''closed'' flag to check
as window.closed was not reliable in IE5 anyway, so I may just stop
using window.closed entirely. I would like to be abel to explain the
sudden appearance of the error, though..

Thanks,
Alistair.


大家好,


我的申请中遇到同样的问题。如果你工作,请告诉我

auornd some来解决IE问题。


我们在我们的应用程序中使用以下代码 -

函数_closeStatusWindow()

{

if(g_statusWindow&&!g_statusWindow.closed)

g_statusWindow.close();

}


感谢Advanace,

Ramesh

Hi All,

I am having same problem in my application. Please let me if you work
auornd some to approach to fix the IE Issue.

We are using folllowing code in our application -
function _closeStatusWindow()
{
if(g_statusWindow && !g_statusWindow.closed)
g_statusWindow.close();
}

Thanks in Advanace,
Ramesh


这篇关于访问window.closed时拒绝权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆