Hi there! Yes this is very easy to do if you know where to look!
You can use the beforeunload JavaScript event in the browser determine the behaviour on an navigation attempt.
You can integrate this JavaScript event with a Nanoflow by passing the nanoflow as logic to be executed to the function called by the event.
Please be aware that some browsers do not allow you to set your own message, but just specify behaviour to determine whether the event is allowed.