title: Suppress the “are you sure you want to leave this page” popup in the Delphi TWebbrowser control
body: <p>I have an Delphi application that uses <code>TWebbrowser</code> component to automate navigation to another web application we have.</p>
  
  <p>My problem is that sometimes IE shows the infamous 'Are you sure you want to leave this page' message and when this happens, my app can't navigate to another pages unless an user clicks on 'Leave this page' button. I can't edit the website code to remove this warning, unfortunately.</p>
  
  <p>This message is plaguing my app for weeks, and I could not reach to a proper solution anymore. What I did is to keep a background process do manually send a keystroke when this window is show, but this is not a good solution because nobody can use the computer while my app is working.</p>
  
  <p>I saw possible solution for C# in the topic below but I need a Delphi code instead. </p>
  
  <p><a href="https://stackoverflow.com/questions/10348692/supress-the-are-you-sure-you-want-to-leave-this-page-popup-in-the-net-webbrow">Supress the &quot;are you sure you want to leave this page&quot; popup in the .NET webbrowser control</a></p>
  
  <p>Any help is very, very appreciated.</p>
  
  <p>Thanks :)</p>