About the BeforeUnload category

Offers simple one line API to define verification dialog shown to user when user is trying to exit or reload page. Can be used to warn if user has any unsaved changes. When changes are save, you can disable dialog with simple one liner.