Prompt before closing during a call

Hi! Does Jitsi Meet have support for confirming before closing the window during an active call? My intention is for the confirmation below to be shown before the window can be closed.

I have tried implementing window.onbeforeunload as shown in this MDN doc. However, Jitsi goes blank after the attempt to close the tab is made. So even if I click “Cancel”, it’s just black, as shown below.

https://paste.pics/2d2d06d25385805bcce36c2b0b06763b (I’m a new user, so I can only have one image per post)

This is the original call image.

https://paste.pics/4fef09e29d44b92a9801b068e5711c53

Maybe there are js console errors … do you see any?

1 Like

this is not possible cause chrome doesn’t allow this since chrome 49, however u could return false onbeforeload method…see this post

one more thing, jitsi-meet has there unload event registered so that when user click close window it dispose the conference to properly send signal to jicofo that user leaving…u need to take care of that to address the black screen.

Whats your usecase??
Using electron framework is the best way to implement it. In my company, we encourage user to download the electron app rather than running on the browser directly. Because as much as we love jitsi-meet, it still lack when it comes to cross browser capability…I mean some of customers still using IE, EDGE and STUPID SAFARI and they outright REFUSE to switch to use Google Chrome!!! And when they use all that, things go south…

Anyway, in short use electron it is much more stable and you have more control over its behaviour…this is just my opinion…:grin: :nerd_face: :innocent:

1 Like

There are none. I believe Jitsi is performing as intended, where resources are cleaned up upon closure of the tab.

What I’m looking for is a way to prevent the resources from being cleaned up, and confirm that the user intends to close the tab, to prevent instances where a user accidentally closes their tab with Command/Control + W.

this is not possible cause chrome doesn’t allow this since chrome 49, however u could return false onbeforeload method…see this post

Thank you! I’ll check this out and try to implement it :slight_smile:

Whats your usecase??

My use-case is building this into a website unfortunately :frowning:

one more thing, jitsi-meet has there unload event registered so that when user click close window it dispose the conference to properly send signal to jicofo that user leaving…u need to take care of that to address the black screen.

Is there any documentation about this? I want to prevent Jitsi from disposing the conference before the confirmation pops up.

Jitsi already supports this confirmation when the “Back” button is pressed, as shown below. This confirmation doesn’t show up for “Refresh” button and “Close” button for some reason.

In which browser do you see this dialog when clicking “back” button?

Chrome! But you have to be in a conference call with at least one other person.

are you using your own deployment? or connecting via api (external_api or lib-jit-meet)?

Interesting, testing this on meet.jit.si, I don’t have such experience with the latest chrome.

Interesting, testing this on meet.jit.si, I don’t have such experience with the latest chrome.

How did you test this? In Chrome, I opened two different windows, and started a conference. Then I tried to click “Back” and “Refresh”, but no confirmation prompt popped-up to confirm that I wanted to leave the call, like in the screenshot below.

are you using your own deployment? or connecting via api (external_api or lib-jit-meet)?

We are using lib-jit-meet.

You said there is already such prompt in jitsi-meet, so I said that I don’t see it when testing with two tabs on meet.jit.si.

1 Like

if you are following this example then here is the function and here it is being called

1 Like

You said there is already such prompt in jitsi-meet, so I said that I don’t see it when testing with two tabs on meet.jit.si.

Ahh okay, thank you! I understand what you mean now.