Detecting browser tab closures is essential to prevent data loss or unwanted navigation.
Using this plugin, you can prompt users with a confirmation dialog, ensuring they don't accidentally leave the page with unsaved changes or important information.
This module works on all versions of Joomla.
After installing it, go to System > Plugins > System - Close Tab Warnings to started.
There are 3 parameters you need to set:
- Client Both | Administrator | Site : The area to which this warning will apply.
- Apply to form
- On all forms
- Only on the form selected
- On all forms except those selected
- Keep User's Session
When you select the value of "Apply to form" as "Only on the form selected" or "On all forms except those selected", you need to fill in the path to that form (jQuery Path).
To find the path to the form, you can use firebug or your browser's developer tools ("Ctrl + Shift + I" on Windows or "Cmd + Option + I" on Mac).
For example, to enable tab closing notification for user data entry form on Joomla 5 (admin page), you set as below:
- Client Administrator
- Apply to form Only on the form selected
- Form selector (jQuery Path) form#user-form
You will get a warning like below when you accidentally close a tab: