搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

window.onbeforeunload not functioning if restore previous session is enabled

  • 1 个回答
  • 1 人有此问题
  • 7 次查看
  • 最后回复者为 cor-el

more options

I have application script that uses window.onbeforeunload to perform a certain function when the window or tab is closed. This works fine in firefox (and other browsers), but won't work if the restore previous session browser setting is enabled. Any help is appreciated.

I have application script that uses window.onbeforeunload to perform a certain function when the window or tab is closed. This works fine in firefox (and other browsers), but won't work if the restore previous session browser setting is enabled. Any help is appreciated.

所有回复 (1)

more options

If you use Restore Previous Session then you aren't leaving the page if you close Firefox because you can resume the next time you open Firefox and you aren't suffering data loss unless the page uses complicated JavaScript that might not make it possible to restore the page. So that might be causing window.onbeforeunload not functioning as expected by you. I don't know whether this is intentionally.