I would like to know if there is a possibility to trigger an event when the user leaves the current page. More specifically, I would like to trigger a javascript Window confirm() method.
This could be useful in scenarios in which the user has unsaved changes, for example.