title: How to cancel browser close window?
body: <p>Is it possible to cancel the browser close window event? Or at least add a message prompting the user whether they are sure they want to leave the page? I tried doing this with the beforeunload event, but it still closes the browser. I am looking for something similar to Microsoft's exchange website.</p>
  
  <p>Thanks!</p>
  
  <p><img src="https://i.stack.imgur.com/tzTK3.png" alt="enter image description here"></p>