title: How can I ask users to confirm before leaving the page on iOS safari?
body: <p>I now have:</p>
  
  <pre><code>window.onbeforeunload = confirmFirst;
  
  function confirmFirst() {   
    return "Leave the page?"; 
  }   
  </code></pre>
  
  <p>This can give users a prompt to confirm that they are leaving the page on all major browsers, except on iOS safari. How can I make it work? </p>
  
  <p>I want to implement this as my users often accidentally swipe right (back button) and left the page after typing in some long paragraphs on my site. Thank you!</p>