Rocket.Chat.Electron icon indicating copy to clipboard operation
Rocket.Chat.Electron copied to clipboard

Window.close() in Electron 3.9.*

Open shevchukma opened this issue 2 years ago • 10 comments

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: 3 8_ In 3.9: 3 9_

Please make it possible to call windows.close() to close the window.

How to Reproduce

  1. Add a window.close() call to the end of the /usr/share/jitsi-meet/static/close.js file.
  2. End the call by pressing the red button.

Describe your Expected behavior

The call window closes.

Anything else

Related issues: 2631, 2633

Are you willing to submit a code contribution?

  • [ ] Yes, I am willing to submit a Pull Request!

shevchukma avatar Apr 19 '23 13:04 shevchukma

Still an issue in 3.9.5

ankar84 avatar Jun 20 '23 04:06 ankar84

@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 avatar Jul 06 '23 20:07 jeanfbrito

@jeanfbrito we have added a window.close() at the end of the onLoad() after insertTextMsg('hintMessage', getHint())

shiryov avatar Jul 07 '23 04:07 shiryov

@jeanfbrito actually #2701 do not fix that problem! Jitsi window still remain open after call was finished on new 3.9.6

ankar84 avatar Aug 04 '23 04:08 ankar84

Here is a screencast showing problem remain in 3.9.6 jitsi-window01

ankar84 avatar Aug 04 '23 05:08 ankar84

Version 3.9.6 This is jitsi call dialog in which close2.html was opened after the call ended.

image

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.

shiryov avatar Sep 19 '23 11:09 shiryov