Firefox 4 onBeforeUnload 自定义消息 [英] Firefox 4 onBeforeUnload custom message

查看:29
本文介绍了Firefox 4 onBeforeUnload 自定义消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Firefox 3 中,我能够编写自定义确认弹出窗口:

In Firefox 3, I was able to write a custom confirmation popup with:

window.onbeforeunload = function() {
   if (someCondition) {
      return 'Your stream will be turned off';
   }
}

现在在 Firefox 4 中,它不显示我的自定义消息.它提供的默认消息甚至不符合我的应用程序的功能.

Now in Firefox 4, it does not show my custom message. The default message that it provides is not even accurate to what my application does.

这个默认消息可以被覆盖吗?

Can this default message be overridden?

推荐答案

来自 MDN:

请注意,在 Firefox 4 及更高版本中,返回的字符串不会显示给用户.请参阅错误 588292.

Note that in Firefox 4 and later the returned string is not displayed to the user. See Bug 588292.

这个错误"实际上是一个(恕我直言有问题的)功能..所以没有办法在 Firefox 4 中显示消息.如果你认为它应该改变,评论那个错误,这样 Firefox 开发人员就会知道人们实际上希望能够显示自定义字符串.

This "Bug" is actually a (imho questionable) feature.. so there's no way to display the message in Firefox 4. If you think it should be changed, comment on that bug so the Firefox developers will know that people actually want to be able to show a custom string.

这篇关于Firefox 4 onBeforeUnload 自定义消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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