When the user left the web page, you will find an interesting alter to complain to you:

This is how to work to attract the user as a small and unpopular web app:
window.addEventListener('visibilitychange', function() {
if (document.visibilityState === "hidden") {
//when you left the page
alert('Cruel, heartless, you abandoned me alone! ☆*: .。. o(≧▽≦)o .。.:*☆')
}else if (document.visibilityState === "visible") {
//when you went back the page
console.log('Master! Welcome, let me service to you ヾ(≧▽≦*)o');
}
});