79081702

Date: 2024-10-12 19:07:02
Score: 0.5
Natty:
Report link

More recently, this has worked for me; however you need to watch for browser compatabilty.

document.addEventListener('visibilitychange', function() {
  if (document.hidden) {
    // Perform logout action here
    // window.location.href = 'logout.php'; 
  }
});

https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event

Reasons:
  • Whitelisted phrase (-1): worked for me
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Mike