Window.close() in Electron 3.9.*
Search before asking
- [X] I had searched in the issues and found no similar issues.
Operating System
- [ ] macOS
- [X] Windows
- [ ] Linux
Operating System Version
Windows 10
It happens on the web browser too?
No, it just happens on the Desktop app
Rocket.Chat Desktop App Version
3.9.3
Rocket.Chat Server Version
5.4.5
Describe the bug
We use Rocket Chat and Jitsi integration for calls.
In the /usr/share/jitsi-meet/static/close.js file, we add a call to window.close() so that the window closes when the end call button is pressed.
In browsers and in desktop app version 3.8.*, this worked fine.
We see that the windows open differently. In version 3.9 in the sandbox.
In 3.8:
In 3.9:

Please make it possible to call windows.close() to close the window.
How to Reproduce
- Add a window.close() call to the end of the /usr/share/jitsi-meet/static/close.js file.
- End the call by pressing the red button.
Describe your Expected behavior
The call window closes.
Anything else
Are you willing to submit a code contribution?
- [ ] Yes, I am willing to submit a Pull Request!
Still an issue in 3.9.5
@ankar84 @shevchukma do you can share where is the window.close() exactly?
I'm trying to debug but I'm having some troubles with the close function.
Could you show me how to make the same server like you?
@jeanfbrito we have added a window.close() at the end of the onLoad() after insertTextMsg('hintMessage', getHint())
@jeanfbrito actually #2701 do not fix that problem! Jitsi window still remain open after call was finished on new 3.9.6
Here is a screencast showing problem remain in 3.9.6
Version 3.9.6 This is jitsi call dialog in which close2.html was opened after the call ended.
close2.html:
<html>
<head>
<!--#include virtual="/base.html" -->
<link rel="stylesheet" href="css/all.css"/>
<!--#include virtual="/title.html" -->
<script><!--#include virtual="/interface_config.js" --></script>
<script src="static/close.js"></script>
</head>
<body>
close.js:
function onLoad() {
// Intentionally use string concatenation as this file does not go through
// babel but IE11 is still supported.
// eslint-disable-next-line prefer-template
const thankYouMessage = 'Thank you for using ' + interfaceConfig.APP_NAME;
// Works only for close2.html because close.html doesn't have this element.
insertTextMsg('thanksMessage', thankYouMessage);
// If there is a setting show a special message only for the guests
if (interfaceConfig.CLOSE_PAGE_GUEST_HINT) {
if (window.sessionStorage.getItem('guest') === 'true') {
const element = document.getElementById('hintQuestion');
element.classList.add('hide');
insertTextMsg('hintMessage', interfaceConfig.CLOSE_PAGE_GUEST_HINT);
return;
}
}
insertTextMsg('hintMessage', getHint());
window.close();
}
By the way, it works in Google Chrome, the tab with close2.html closes.