title: Detect if user "leaves" webpage
body: <p><strong>Before marking this question as duplicate READ THIS QUESTION</strong></p>
  
  <p>I'm searching for a way that when a visiter leaves my webpage, he is redirected to another page. (He shouldn't close the page)</p>
  
  <p>Some examples:</p>
  
  <ol>
  <li>I got the page open and I open another tab in my browser, then the person should be redirected to the other page, because he left the current "open" tab.</li>
  <li>When the person opens another program, the website isn't "active" anymore and it should redirect to another page.</li>
  </ol>
  
  <p>I don't want an action when the user leaves the webpage, I want a reaction if he leaves it open but opens another program, another tab, etc.</p>