Firefox 4的onBeforeUnload自定义消息 [英] Firefox 4 onBeforeUnload custom message
问题描述
窗口.onbeforeunload = function(){
if(someCondition){
return'Your stream will be turned off';
$ b现在在Firefox 4 ,它不显示我的自定义消息。它提供的默认消息甚至不准确,我的应用程序。
这个默认的消息可以被覆盖吗?
解决方案通过 MDN :
请注意,在Firefox 4及更高版本中,返回的字符串不会显示给用户。查看错误 588292 。
这个Bug实际上是一个(imho可疑的)特性,所以在Firefox 4中没有办法显示这个消息。如果你认为应该改变它, Firefox开发人员会知道,人们实际上希望能够显示自定义字符串。
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';
}
}
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?
解决方案 From MDN:
Note that in Firefox 4 and later the returned string is not displayed to the user. See Bug 588292.
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屋!