谷歌浏览器onbeforeunload错误的行为与iframe [英] Google chrome onbeforeunload wrong behavior with iframe
问题描述
Google Chrome问题
但我提到过,例如,Google文档处理这种情况。谁能给我一个解决方案?
重要提示:我没有实际的iframe内容,因为它是第三方的html编辑器(WYSIWYG)。
我知道这是一个古老的问题,但只是帮助那些通过搜索来到这里的人: 现在在这里修复。
由于chrome 10的问题应该得到解决。
有一个相关错误虽然在这里。
所以,总之如果您仍然无法在框架上触发 onbeforeunload
,可能是因为通过JavaScript更改了内容,如 document.open
document.write
document.close
等。
Let say I have two pages. One of them contains another one inside as iframe. If you subscribe to onbeforeunload event on the parent page, then this event doesn't triggers if you close tab when iframe is in focus. I suppose it is a bug as written here: Google Chrome issues
But I mentioned that, for example, google docs handle this situation. Can anyone give me a solution? Important note that I have no actual access to the iframe content as it is a third party html editor (WYSIWYG).
I know it is an old question but just to help people who are coming here through Search :
The bug is fixed by now here.
Since chrome 10, the issue should be fixed.
There is a related bug though here.
So, in short if you still not able to fire "onbeforeunload
" on frames, it could be due to change in the content through JavaScript like document.open
document.write
document.close
etc.
这篇关于谷歌浏览器onbeforeunload错误的行为与iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!