Hacker News new | past | comments | ask | show | jobs | submit login

Weird window.onbeforeunload was not mentioned



Probably because this is discouraged.

Check here: 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.


Because it is synchronous/thread-blocking.




The deadline for YC's W25 batch is 8pm PT tonight. Go for it!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: