Just for curiosity sake - what's the reason behind that development? Speaking from a user's perspective, if I may, that seems a bit too much :)
However, the onbeforeunload javascript event seems to be what you need.
Create a New script and every time the user tries to leave the app the browser's default confirmation message will pop up. Please note that the support for this varies depending on the browser.
The reason is just business related (client wants the users to be warned that they will not complete the request if they leave the page).
The onbeforeunload (tryed that) works when trying to close the window but it doesn't allow me to show a custom popup and it doesn't cover the navigate (this is a reactive web app).