esedic
8/8/2015 - 9:37 AM

Detect When Browser is Closed

Detect When Browser is Closed

function checkBrowser() { 
  // triggers on clicking the close button, Alt+F4 , File->Close 
  if(window.event.clientX < 0 && window.event.clientY < 0) { 
    window.open("somefile.html", "closewindow",'left=12000,top=1200,width=120,height=50');
  }
}