exPatchWindowClose will allow you to capture the close button of the game window on Windows and if the player tries to navigate away in a HTML5 game.
Useful if you need to do certain operations before ending the game in that manner or protecting the player from navigating away from the page for HTML5 games.
HTML5 only allows for a dialog message to be shown due to security restrictions. On Windows you can do whatever you wish with the close button event.
This Extension works for Windows (& YYC) and HTML5 targets.