是否存在 window.unload 事件不触发的条件?

Are there any conditions under which window.unload event does not fire?

我在前端使用 navigator.sendBeacon 来告诉服务器用户何时进入和离开页面(通过 window.loadwindow.unload)。我正在记录 arrival/departure 服务器端的时间。我注意到有些情况下有到达时间但没有出发时间。

是否存在 window.unload 事件未能触发的常见情况,即不是 browser/system 崩溃?可能是在重定向、后退按钮或在所有内容加载之前离开页面的导航?

不,除了 browser/system 崩溃之外,没有任何条件 window.unload 事件将无法触发。所有主要浏览器和所有主要浏览器的许多早期版本都支持它。

See here as well.