Firefox 4 onBeforeUnload custom message

前端 未结 4 2256
眼角桃花
眼角桃花 2020-11-27 17:21

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

window.onbeforeunload = function() {
   if (someCondition) {
      retur         


        
4条回答
  •  情话喂你
    2020-11-27 18:04

    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.

提交回复
热议问题