bitwarden / clients

Bitwarden client apps (web, browser extension, desktop, and cli).
https://bitwarden.com
Other
9.39k stars 1.26k forks source link

Firefox extension closes itself on any interaction/navigating away from window #3013

Open pm98zz-c opened 2 years ago

pm98zz-c commented 2 years ago

Steps To Reproduce

  1. Click on the Bitwarden extension in the toolbar
  2. Fill in your password
  3. Get presented with 2FA Yubikey prompt
  4. Switch your keyboard layout (or perform anything that takes focus away) to be able to use the Yubikey

Expected Result

The extension popup to stay visible to be able to input my 2FA

Actual Result

The extension popup closes itself and reset its states, preventing login

Screenshots or Videos

Sorry, tried to to record it, but the popup itself isn't visible in the screencast (both under wayland and xorg)

Additional Context

Admittedly a problem for very few users, but it does prevent me from login at all:

This only happen on Firefox, in Chrome/Brave, the popup stays open. It also used not to be the case in FF and did work as expected before. You can also reproduce more easily than the steps described above by moving away from the browser's window using alt-tab:

Operating System

Linux

Operating System Version

Fedora 36 with Gnome (both Wayland and Xorg)

Web Browser

Firefox

Browser Version

102.0 (64-bit)

Build Version

2022.5.0

dbosompem commented 2 years ago

Hi @pm98zz-c welcome, and thank you for raising this issue. Whiles it might affect just a few users, the team will make time to reproduce, prioritise and get into the roots of the issue. Very appreciated!

kapitainsky commented 2 years ago

It has been always like that and is very annoying.

Workaround is to open BW in sidebar instead of pop up - in Firefox menu: View->Sidebar->Bitwarden

in macOS there is keyboard shorcut to do this quicker: ⌥⇧Y

on other OS when you go to the Sidebar menu it should show your platform shortcut.

Hinton commented 2 years ago

This is a known limitation in Firefox. Firefox will close any popup whenever the browser window loses focus, or if the popup itself loses focus within Firefox. And there is to my knowledge no api that allows this behavior to be prevented.

Chromium based browsers keeps the popup open until you click outside it within the window.

pm98zz-c commented 2 years ago

Well, that's the thing. I've been using FF and the Bitwarden extension without ever noticing that behaviour for a few years now. It is very possible that something changed in Firefox at some point, I'm sadly unable to pinpoint when/how. Until a few weeks ago, I was on Debian, which ships a modified version of FF, call Firefox ESR. I never had that issue, and as I said, been using that setup for quite a while.

I've then re-installed and choose to give Fedora a try for a change. That's when I immediately noticed the bug/change in behaviour. Now, AFAIK, Firefox ESR is just standard Firefox with some non-free/copyrighted bits removed to comply with Debian policy, so they should behave the same. Maybe it was lagging a bit, I "think" at some point ESR was based of the LTS version, with some security patches manually applied, although I was under the impression it was no longer the case. Could be the behaviour did change upstream but had not yet reach the Debian flavoured version?

So, what I'm 100% sure of, is that it did not behave the same "before", "before" being not older than a month ago at most.

Sadly, I'm not of great help to be able to tell what the differences could have been between my old setup and the new one, given it's been re-installed from scratch, so I can't really tell which version of Gnome, FF, Wayland etc I was on before. Sorry again for the lack of details and clarity.

pm98zz-c commented 2 years ago

Right, not sure why I did not think of checking before, but yes: looking at https://packages.debian.org/search?keywords=firefox all versions of debian except Sid (experimental) are shipping FF ESR. I was on a mix of Bookworm and Sid, so presumably on FF ESR. As https://wiki.debian.org/Firefox#From_Debian_packages states, ESR is lagging behind the mainstream one, which probably explains the difference. Not sure if it is worth investigating, and/or maybe reaching to Mozilla.

imjuzcy commented 2 years ago

For what it's worth, it has been like that since forever. Check #443. It's been like that since at least 2017 on the mainstream FF.

dwbit commented 2 years ago

As an alternative, in Firefox + Opera, you can also enable the sidebar icon to create a persistent experience.

hboetes commented 2 years ago

Work around: press the pop out button in the top left corner.

liquidgecka commented 1 year ago

Hrm, the lastpass extension does not seem to have this issue. As a recent convert this is a usability issue for me so I don't think its 100% firefox forcing the window closed, or at least there is a way to work around it at least.

kapitainsky commented 1 year ago

And as we all know they got few more serious issues:) nothing is perfect.

It is a wee annoying but you can use View->Sidebar->Bitwarden or (at least on macOS) ⌥⇧Y keyboard shortcut

liquidgecka commented 1 year ago

And as we all know they got few more serious issues:) nothing is perfect.

Oh trust me I completely understand. I was just pointing out that its not as futile as "This is a known limitation in Firefox." would imply. Frankly I would be super happy if I could just get the bitwarden extension button to open the sidebar by default, that would be was easier to explain to my wife than giving her a keyboard shortcut.

I used my last password manager from like 2010 until the end of last year I can say that I am super happy that this is the only real usability issue that I have encountered in the migration. If I had more free time and front end skills that didn't stop at HTML 1.0 I would attempt to help. =)

alexiri commented 1 year ago

I'm not sure why this ticket says this is only happening with Firefox, I have the same issue with Chrome. The extension closes even if you're in the middle of editing an entry and you change focus to another application to copy text.

patrickkelso commented 1 year ago

A user can disable this in Firefox about:config by setting ui.popup.disable_autohide to true. However this means you also have to hit escape to close the right click context menu.

imjuzcy commented 1 year ago

A user can disable this in Firefox about:config by setting ui.popup.disable_autohide to true. However this means you also have to hit escape to close the right click context menu.

While this does solve the problem described in this issue, but the side effect is everything will not close when clicking outside of the pop-up, including the right-click context menu. When that happens, using the escape key can close the pop-up.

JP95Git commented 5 months ago

Facing this issue since our IT introduced BitWarden. Opening BitWarden in a new popup works mostly, but this button is missing at the login screen:

Login is not possible using copy+paste.

A Workaround:

Edit: I noticed the same behaviour in the MyJDownloader extension, so this is likely a Firefox issue. Edit2: The addon Kee (https://addons.mozilla.org/de/firefox/addon/keefox/), which is used for KeePass does not have this issue.

keshavkaul commented 2 weeks ago

This issue has the worst experience when trying to login with 2FA enabled. Annoying. There is no pop out into new tab icon when logging in. Thankfully the sidebar trick worked. Thanks @kapitainsky.