The only solution which comes to my mind is to use timeouts on the server side. For example onunload event start the timer and onload resets it. If the timeout is reached then no new page has been loaded. But I think this is not reliable solution, the more reliable is to use sessions timeout.

can any one please help me to find a solution for tab close event in java script is not working in chrome browser. it works well in IE and Firefox
my code is below

window.onbeforeunload = function() 
                  {
                       if(allow == false) 
                       {
                            confirmClose=confirm("Are you sure you want to quit?");                                             
                       }

                       if (confirmClose == true)
                       {
                            alert('tab closed');
                       }
                       else
                       {
                            return false;
                       }
                  }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.