-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancelling Reload site
prompt still refreshes the page
#15198
Comments
We do not have any such reload, this is handled by the browser not jitsi-meet, isn't it? |
Yes, the prompt showed probably because jitsi-meet told Chrome that there is some dirty info on the page. So the issue here is probably because jitsi-meet did not handle the return. |
Can you show a screenshot of that dialog? There is no such thing handled in jitsi-meet. |
https://dev.to/chromiumdev/sure-you-want-to-leavebrowser-beforeunload-event-4eg5 |
Then it might be a case of adding a handler to deal with it |
When I do the shortcut for reload the page reloads. There is no dialog. This is what I experience. |
Did you start recording in step 1? |
vid.mp4 |
Thanks for the video. You are right, I was skipping that part, sorry and I was not aware of the dialog. We do have it, but still it is the browser one and so the strings in it are not available in jitsi-meet.
I'm not sure you can detect whether the user has clicked cancel or not https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event |
Yes you can, that is the sole purpose of that dialog, to prevent users from closing their window resulting in a catastrophic disaster, i.e. loss of data |
In fact, it would be great if jitsi always pops this dialog for any refresh as I see no use case for a refresh. I reported an issue here jitsi/jitsi-meet-electron#986 |
Refresh is actually an important part of the meeting experience. Anytime a client gets into an inconsistent state (connected to new backends, failure in existing connections) that cannot be resolved internally, a reload is triggered to rejoin the meeting. |
If you can detect when the user clicks Cancel, please share it with us or create a PR. I'm not familiar with that and a simple search shows that this is not possible with current browser API. |
ok will do, give me a while |
https://jsfiddle.net/2tc3krz4/4/ has different behaviors when clicking I think jitsi is lacking the |
The problem is that when the reload confirmation dialog appears if you click cancel the local recording is stopped and saved. Have you been able to check the code I posted above? It is already calling
|
|
Seems there is no reliable way to do that for now. |
Can I suggest blocking F5 and ctrl+R for refreshing and allow refreshes only when a user clicks on the browser's refresh button or click on URL and press enter In other words:
|
After looking at the code snippet mentioned by @damencho I understand that regardless the user clicks reload / cancel the browser will stop the recording first as it is notified that a possible unload is about to occur thus triggering the before unload event which is a justified approach. To my knowledge there was only one person in that meeting and reloading the page should technically close that meeting as the only recipient left the meeting thus saving the recording, have you tried this with multiple users in the meeting? We could probably add a condition where if the meeting isn't empty the recording shouldn't stop. |
|
I think a better approach would be to shift the stop recording functionality to take place when the Also I noticed that the use of This will help:
My references:
|
From what I understand of your approach:
Correct? If yes, then I agree yours is the better approach |
Yes that's exactly what I'm trying to say 👍 |
You cannot execute async code in those events, it is unreliable. |
@damencho then are we better off with blocking F5 and ctrl+R? |
I don't think we will want to block that. |
You can configure it on your deployment via some of the empty file hooks in index.html. |
@damencho any examples of file hooks in index.html? |
https://github.com/jitsi/jitsi-meet/blob/master/head.html The content of these files are included in index.html Line 3 in 0636527
You can use an nginx rule to override the file location, so you can put the files in /etc/ folder or somewhere else which is different than /use/share/jitsi-meet so upgrades will not overwrite your changes.
|
Thanks, I'm using https://github.com/jitsi/docker-jitsi-meet, trying to map the files you mentioned, but the default does not expose any filesystem to the host |
Yeah we need to add custom meet.conf where you can add the aliases to the files in /config and put the files in config. Any PRs are welcome. |
I will probably modify <script>
document.addEventListener('keydown', (e) => {
e = e || window.event;
if(e.keyCode == 116 || (e.ctrlKey && e.keyCode == 82) ){
e.preventDefault();
}
});
</script> |
What happened?
vid.mp4
Reload site
pops upCancel
My jitsi runs in docker using this commit
24ae693
Platform
Browser / app / sdk version
Chrome 129.0.6668.100 (Official Build) (64-bit) /
Relevant log output
No response
Reproducibility
More details?
No response
The text was updated successfully, but these errors were encountered: