Is there a way in AngularJS or Javascript to detect that the user is leaving my website (can be closing his browser or entering another page) and to prompt a modal? In this modal I want to ask the user why he is leaving.
Also, is it OK to have something like this? Will my website be blacklisted due to this "annoying: feature?