Skip to content

added beforeunload confirmation during active meeting#16933

Open
Adarsh765-jpg wants to merge 2 commits intojitsi:masterfrom
Adarsh765-jpg:fix/beforeunload-confirmation
Open

added beforeunload confirmation during active meeting#16933
Adarsh765-jpg wants to merge 2 commits intojitsi:masterfrom
Adarsh765-jpg:fix/beforeunload-confirmation

Conversation

@Adarsh765-jpg
Copy link

This PR adds a beforeunload handler when a conference is active to prevent accidental tab closure or refresh disconnects.

Implementation:

  • Attached beforeunload listener when joining a conference
  • Removed listener when leaving the conference
  • Uses the browser’s standard confirmation popup

Testing:

  • Reload/tab close shows confirmation during active call
  • No popup after leaving the meeting
  • Verified navigation away behavior

Fixes #16928

@saghul
Copy link
Member

saghul commented Feb 12, 2026

If this is to land, it must be configurable and disabled by default, since that is our current behavior.

@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

@Adarsh765-jpg
Copy link
Author

@saghul thanks for the feedback. I'll update the implementation to make it configurable and disabled by default.

@Adarsh765-jpg
Copy link
Author

@saghul I’ve set it as the default now, and it can be enabled from Settings → General if someone wants to use the feature, just like you suggested. Let me know if anything needs tweaking or if i can help with some other issues.

@Adarsh765-jpg
Copy link
Author

@saghul waiting for approval


if (typeof window !== 'undefined') {
window.addEventListener('beforeunload', beforeUnloadHandler);
if (configEnabled || settingEnabled) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also check for undefined, which is falsey, but you likely want the user setting to take precedence, if set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Confirmation dialog before closing/reloading the meeting tab

3 participants