Skip to content

added beforeunload confirmation during active meeting#16933

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

added beforeunload confirmation during active meeting#16933
Adarsh765-jpg wants to merge 3 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.

Copy link
Author

Choose a reason for hiding this comment

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

@saghul I've made the changes. Please go through it.

- Set default enableBeforeUnloadConfirmation to undefined
- Replace manual OR logic with getPropertyValue
- Maintains precedence order: JWT > URL > Settings > Config

Implements review feedback from saghul.
@Adarsh765-jpg
Copy link
Author

@saghul Could u please review my new changes?

@farapholch
Copy link

Any news for approval?

@Adarsh765-jpg
Copy link
Author

@saghul @farapholch still waiting for the approval

@farapholch
Copy link

any news? @saghul

@damencho
Copy link
Member

damencho commented Mar 5, 2026

Have you tested this? As it seems to me it will not work.

@damencho
Copy link
Member

damencho commented Mar 5, 2026

There is another PR trying to do the same #17052 and there they discovered that it will not work with changes only in jitsi-meet.

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

5 participants