Use the javascript Page Visibility API to determine whether the user has closed the browser window (html page)
Page Visibility API Introduction Sometimes, developers need to know that the user is leaving the page. The common method is to listen for the following three events. pagehide beforeunload unload However, these events may not fire on the phone, and the page just closes. Because the mobile phone system can directly transfer a process to […]