Skip to content
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

Leapp blocks CTRL+R keybind (and others?) after SSO window closes for Chrome browser #185

Closed
Plasma opened this issue Oct 24, 2021 · 26 comments
Labels
bug Something isn't working

Comments

@Plasma
Copy link
Contributor

Plasma commented Oct 24, 2021

Describe the bug
When AWS SSO dialog appears and after you perform the login, the SSO dialog closes, and from now onwards, pressing CTRL+R keybind in a regular browser like Chrome (at least, and unrelated to Leapp app) does not work.

I haven't tested whether other keybinds are affected. It appears Leapp is maybe "blocking" this keybind from Chrome (and maybe other apps/keybinds?).

To remedy the issue, re-show the Leapp window (via Leapp icon -> Show) and CTRL+R works again.

Leapp Version
Add the version of your Leapp (you can find it under taskbar -> about or Leapp -> about on MacOS X)

To Reproduce
Steps to reproduce the behavior:

  1. Open Leapp, and hide it so it sits in the system tray
  2. Click on the Leapp tray icon and choose to turn on a profile
  3. The SSO window appears to retrieve the credentials - complete the SSO sign-in process
  4. Once the SSO window has closed, try and press CTRL+R in a Chrome browser tab (for example) and notice the page does not reload
  5. If you now cause Leapp to Show (tray icon -> Show) and then close the dialog, the CTRL+R Chrome keybind works again

Expected behavior
Leapp should not be causing the CTRL+R (and maybe other keybinds) from working after the AWS SSO window is dismissed.

Screenshots
n/a

Desktop (please complete the following information):

  • OS: Windows 10
  • Leapp Version 0.7.3

Additional context
I wonder whether the SSO login window is still "visible" or capturing keybinds even though its dismissed/closed?

The CTRL+R keybind is only prevented when the SSO window closes, up until that point, the keybind works fine.

@Plasma Plasma added the bug Something isn't working label Oct 24, 2021
@pethron pethron changed the title Leapp steals CTRL+R keybind (and others?) after SSO window closes for Chrome browser Leapp blocks CTRL+R keybind (and others?) after SSO window closes for Chrome browser Oct 25, 2021
@pethron
Copy link
Contributor

pethron commented Oct 25, 2021

Thanks, @Plasma, for reporting this. I've changed the wording with "blocks" because "steal" is a bit destructive for an application that manages credentials (this morning, I almost had an hearth attack seeing this). We'll check if, in some way, Leapp is interfering with other chromium apps.

@Plasma
Copy link
Contributor Author

Plasma commented Oct 25, 2021

Thanks @pethron , sorry for the heart
attack 🤭

I feel like maybe the window still has “focus” or something.

@Plasma
Copy link
Contributor Author

Plasma commented Oct 30, 2021

Hi @pethron I have a feeling this may be due to https://github.com/Noovolari/leapp/blob/master/src/app/services/aws-sso-oidc.service.ts#L165 causing the browser-window-blur event to not be fired in https://github.com/Noovolari/leapp/blob/master/electron/main.ts#L113 which restores CTRL+R/F5 keybind functionality when the SSO window is dismissed.

I can confirm that if the SSO window pops up, if I close it the bug is also there, so I think that is the issue.

@praider
Copy link

praider commented Nov 5, 2021

If it helps, I've experienced a similar issue. F5 usage was blocked system wide (Chrome, Visual Studio, etc.,). I killed the app to perform an update and F5 is now working again (although I haven't tried signing into AWS yet). One other note is that ctrl+F5 worked as expected

@ericvilla
Copy link
Contributor

Hi! I think a possible solution is to add this.ssoWindow.hide(); before

this.ssoWindow.close();

In that way, it fires the on blur event for the browserWindow before closing it. I've already tried it and it works. Let me know if I'm missing something. @urz9999 what do you think about that?

@urz9999
Copy link
Contributor

urz9999 commented Nov 8, 2021

I've checked some examples online which confirm your theory, for example https://www.tabnine.com/code/javascript/functions/electron/BrowserWindow/hide
It seems that when you want to close a window you also need to let it lose focus: this behavior typically happens when an app is configured also for hiding in MacOS instead of closing.

@ericvilla
Copy link
Contributor

Fixed with the last v0.7.4 release

@drov0
Copy link

drov0 commented Dec 14, 2021

Hello, I am still seeing the issue on ubuntu 20 with leapp 0.8.0, did we get a regression ?

@ericvilla
Copy link
Contributor

ericvilla commented Dec 14, 2021

HI @drov0, thanks for reporting! I guess that's because you fall into an error condition, where we forgot to call BrowserWindow's hide() method:

this.ssoWindow.close();

To confirm that's the case, we've to double-check it by doing a smoke test. We'll fix it for the next release.
May I ask you to provide the application logs? In that way, I think we can confirm what I've supposed 🙂

@drov0
Copy link

drov0 commented Dec 14, 2021

@ericvilla thanks for the quick response ! Where can I see the logs ? I wonder if the issue is tied to the browser or the actual window (where we can see and configure sessions). If I close the window I get the keybind, but if it's just minimized, the keybind is no tthere.

@ericvilla
Copy link
Contributor

You're welcome! You can find logs path here.
Btw, I'm pretty sure the issue is related to the Electron BrowserWindow.

@drov0
Copy link

drov0 commented Dec 14, 2021

I'm afraid I don't have any logs. I have a bunch of files in ~/.config/Leapp/ but no log.logs

@drmikecrowe
Copy link

@ericvilla I think this is still an issue (somehow), tho it may be unrelated: When I minimize Leapp to the tray, I lose ^R/F5 functionality in all my browsers. If I leave the Leapp window open, all works fine.

LMK if you want me to submit a new issue or if this is a corner case of this one

@ericvilla
Copy link
Contributor

Sure @drmikecrowe! I'll let you know if it is necessary to open a new issue or if it is strictly correlated to this one

@fancywriter
Copy link

I am reproducing it again on version 0.9.0. When window is minimized in tray, CTRL+R doesn't work. If not, it works. Looks very weird.

@fancywriter
Copy link

@ericvilla I don't see anything in .config/Leapp/logs/log.log, but I see in stdout (or stderr) when running Leapp from terminal:

CommandOrControl+R is pressed: Shortcut Disabled

Each time when I am trying to press Ctrl + R (and it doesn't work). The Leapp window is minimized to tray, shouldn't be in focus.

@Plasma
Copy link
Contributor Author

Plasma commented Mar 10, 2022

It seems to be a regression yes, although only occurs after SSO sign-on completes (before I then dismiss Leapp), if I minimize Leapp to tray and re-open it and re-minimize it seems fine again.

@fancywriter
Copy link

@Plasma is there any version older than 0.9.0 which is not affected? Not sure I really need the newest...

@drmikecrowe
Copy link

@ericvilla @Plasma --- this is definitely still an issue with 0.10.0 on Linux/Ubuntu (Gnome 20.10):

 ~  uname -a                                                                                                                                                                                       15  08:37 
Linux mcrowe-xps15-ubuntu 5.13.0-35-generic #40-Ubuntu SMP Mon Mar 7 08:03:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
 ~  cat /etc/lsb-release                                                                                                                                                                           16  08:49 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.10
DISTRIB_CODENAME=impish
DISTRIB_DESCRIPTION="Ubuntu 21.10"

@pethron pethron reopened this Apr 13, 2022
@Plasma
Copy link
Contributor Author

Plasma commented Apr 23, 2022

Yes this a regression with the latest UI update, I had trouble setting up a build environment for it so haven’t had a chance to try and make a PR

@urz9999
Copy link
Contributor

urz9999 commented May 2, 2022

Have you tried version 0.12.0? Is this still an issue? We tried to reproduce this bug with the latest version to no avail.

@Plasma
Copy link
Contributor Author

Plasma commented May 2, 2022

Just tried 0.12.0 and can reproduce:

  1. Open Leapp UI
  2. Sign on using AWS SSO
  3. When you click "Allow" on the SSO prompt (after using credentials) you can't press CTRL+R anymore on eg, a Chrome browser
  4. If I close Leapp UI it works again

@urz9999
Copy link
Contributor

urz9999 commented May 2, 2022

We have tried with electron-localshortcut in this commit: c428547 for branch:
LEAP-570-verifica-leapp-blocks-ctrl-r-keybind-and-others-after-sso-window-closes-for-chrome-browser

Can you try to build the solution and verify it on your side?

@fancywriter
Copy link

@urz9999 confirming that version from this branch works nice - Ctrl+R works again in other windows after minimizing the app.

@ericvilla
Copy link
Contributor

Thank you @fancywriter for the feedback! I think we can close it as soon as a new release is available

@andreacavagna01
Copy link
Contributor

Closing this issue since is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants