3 ms·
Weird window.onbeforeunload was not mentioned
by janci 5y ago
Weird window.onbeforeunload was not mentioned
- openplatypus 5y agoProbably because this is discouraged. Check here: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon#sending_analytics_at_the_end_of_a_session https://developer.mozilla.org/en-US/docs/Web/API/Navigator/s... > However, this is extremely unreliable. In many situations, especially on mobile, the browser will not fire the unload, beforeunload, or pagehide events.
- XCSme 5y agoBecause it is synchronous/thread-blocking.