I need to call a particular JS function when the user exits the Google Chrome browser. I wrote a simple code:
window.onunload = logout;
function logout()
{
window.location = "auth/logout";
}
This code works on other browser but not on Chrome. It is essential for me to bring this functionality to Chrome too because the web browser has a large user base. How could I apply the functionality of the above code to all browsers including Chrome? Alternately, a workaround for Chrome would also be very helpful.