🗓️ July 14, 2019 🏷️ Web API
unload event that is available to us web developers isn’t consistent across browsers (but we already know that many things arent 😂).
Really, if you want to have predictable behavior and need to fire off some event/code when a user leaves/closes your page,
you should be listening to a page
visbility change. Read more here