Closed Bug 1829370 Opened 3 years ago Closed 1 year ago

[ChromeOS] When Installing Addon, the pop up to 'Cancel' or 'Add' buttons not clickable - cannot install any Addon. "PopupNotifications._onButtonEvent: Button click happened before the window was focused."

Categories

(Thunderbird :: Add-Ons: General, defect, P1)

Thunderbird 102
Unspecified
Android
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: anjeyelf, Unassigned)

References

Details

Attachments

(4 files)

Thunderbird Support Forum has been getting several reports of the same problem when trying to install various addons.

All seems to be progressing as normal until the pop up window appears which says :

'Add name of addon? This extension will have permission to.......'
There are two buttons 'Cancel' and 'Add'

Action:
Click on 'Add' button.

Result:
Clicking on the buttons has no effect. They are unclickable.

Error console says :
PopupNotifications._onButtonEvent: Button click happened before the window was focused.

It seems Window does not have focus hence clicking not working.

Problem appears to effect:
Chromebook using Linux OS Gentoo
Ubuntu 22.04

Problem persists in Thunderbird Troubleshooting Mode /safe Mode

Several users reporting the problem in these support questions:
https://support.mozilla.org/en-US/questions/1401115
https://support.mozilla.org/en-US/questions/1411341

Image example of the pop up window where buttons are not clickable, so installation of addon fails.

Please note, this failure is not specific to an addon - it is any addon.

One user provided image of error console.

Summary: When Intalling Addon the pop up to 'Cancel' or 'Add' appeara but not clickable - cannot install any Addon → When Intalling Addon the pop up to 'Cancel' or 'Add' buttons not clickable - cannot install any Addon

I'm trying to see if there is temp workaround - I'll report back if people respond in support forum.
I'm asking those who have the problem to try the following:

As window and buttons do not have focus, try to force this by using the 'Tab' key on keyboard to navigate to see you can get the 'Add' button to have focus.

Please report back on whether this workaround to use keyboard to navigate and get focus on the 'Add' button, so allowing it be a clickable button.

Also discovered others mentioning this issue on other forums.
https://www.reddit.com/r/chromeos/comments/xxd282/is_it_possible_to_install_addons_to_crostini/
https://www.reddit.com/r/swaywm/comments/sc9egv/cannot_add_addon_to_thunderbird_because_i_cannot/

Thanks for bringing this to our attention. Is this issue "Linux only" or "Linux on Chromebook" only?

I'm getting responses in Support Forum that using the 'Tab' key on keyboard repeatedly until it highlights / gets focus on the 'Add' button, allows clicking /press enter to select and complete the install.
So there is a workaround, but it needs investigating why Linux OS is having this problem.

(In reply to John Bieling (:TbSync) from comment #4)

Thanks for bringing this to our attention. Is this issue "Linux only" or "Linux on Chromebook" only?

The majority of people - virtually all reports are those using Linux on Chromebook - Crostini - Gentoo
But one person was using Ubuntu 22.04

I'm trawling through the Support Forum to see if there are more reports which may help with info.

I am able to reproduce this 100% of the time using Thunderbird 115.3.2 on fedora rawhide with sway as my desktop

Exactly the same problem (error: "PopupNotifications._onButtonEvent: Button click happened before the window was focused"), cannot work around with TAB.

Using org.mozilla.Thunderbird 115.4.1 Flatpak package on openSUSE/Tumbleweed.

Summary: When Intalling Addon the pop up to 'Cancel' or 'Add' buttons not clickable - cannot install any Addon → When Installing Addon, the pop up to 'Cancel' or 'Add' buttons not clickable - cannot install any Addon

All,

I have a temporary workaround until it can be fixed:

[https://drive.google.com/file/d/1-fZZFBwcprEJIkEcyAhn4w67fGw8EF1E/view?usp=drive_link]

You can load your favorite add-on by going into this temporary add-on area and install from a file, and it works just fine. The only problem is it goes away when you exit Thunderbird. If there were a way to install a temporary add-on and then give it a permanent home Somehow, then that would work better, but I can't figure that out.

Enjoy!

In my case it was related to poorly working DBus and something like https://github.com/flatpak/xdg-desktop-portal-gtk/issues/332

Anje, can you still reproduce?

Flags: needinfo?(anjeyelf)
Summary: When Installing Addon, the pop up to 'Cancel' or 'Add' buttons not clickable - cannot install any Addon → When Installing Addon, the pop up to 'Cancel' or 'Add' buttons not clickable - cannot install any Addon. "PopupNotifications._onButtonEvent: Button click happened before the window was focused."

I can still reproduce and can't get tabs or accessible features on my Pixelbook to get to the 'Add' prompt when trying to add a Thunderbird extension. Details:
Google Chrome: Version 119.0.6045.212 (Official Build) (64-bit)
Platform: 15633.69.0 (Official Build) stable-channel atlas
Channel: stable-channel
Firmware Version: Google_Atlas.11827.198.0
ARC Enabled: true
ARC: 11189745
Enterprise Enrolled: false
Developer Mode: false

Dupe of bug 1399937, regression caused by bug 1343571 comment #7. See screenshot at the end of https://support.mozilla.org/en-US/questions/1411341, that shows "Button click happened before the window was focused" from here:
https://hg.mozilla.org/mozilla-central/rev/34554df9f50c.
Please also read bug 1399937 comment #37 and bug 1399937 comment #43.

Does sideloading work in this case? Here's how you test it:

Set pref extensions.startupScanScopes to 5 (don't forget to hit enter after changing the value). Then copy the extension you want to install to the extensions directory in your profile. Start TB. You will get a notification in the top right corner on the application menu (hamburger menu). Click on it and follow the prompts.

(In reply to Wayne Mery (:wsmwk) from comment #11)

Anje, can you still reproduce?

I never had a problem because I use Windows OS.
I reported the issue because I saw so many people exhibiting this issue in the Support Forum, but they were all using Linux OS.
Many using Chromebook but issue not exclusive to Chromebook, but all were using Linux versions.

Flags: needinfo?(anjeyelf)

Hi all,

Betterbird has FIXED this bug! I can now load addons/extensions.

I recently learned about Betterbird.

Betterbird is a fine-tuned version of Mozilla Thunderbird.

I brought this bug to their attention last week as it appears in both applications.

They reviewed the bug report and collected some information from me regarding my Chrome OS Linux.

They were quickly able to identify where the bug was, and how to fix it.

Betterbird built a test version with the fix included so I could try it out.

It worked!

Betterbird will be rolling the fix into their next release, which should be available soon. Perhaps in a couple of weeks.

You can read about it in their latest release notes.

Happy New Year!

I guess the idea is that unless the window is focused the click shouldn't be processed (to avoid possible scenarios where you'd get tricked to install something). If no focus, the code currently makes the window focused instead.
Does a second click slightly later then work, for people affected?

(In reply to Magnus Melin [:mkmelin] from comment #18)

I guess the idea is that unless the window is focused the click shouldn't be processed (to avoid possible scenarios where you'd get tricked to install something). If no focus, the code currently makes the window focused instead.
Does a second click slightly later then work, for people affected?

I have tried many times and many ways. You can wait, click again. Nothing works.

So far, for me, the only solution that works is whatever the Betterbird developers changed in the code.
They did something, exactly what I do not know. It took them less than one day to fix this bug.
All I do know is I'm happily running with all of my addons. The program works as it is supposed to now.

I'm simply very tired of waiting for Thunderbird developers to implement the same fix. I don't know why it's not as simple to fix as Betterbird made it seem. After looking at all of the information in this bugzilla report they knew immediately what the problem was and how to fix it and they implemented that fix in less than one day.

(In reply to Magnus Melin [:mkmelin] from comment #20)

While https://github.com/Betterbird/thunderbird-patches/blob/main/115/bugs/1829370-add-on-installation-non-focused-linux.patch "fixes" the non-working buttons it's disabling the security fix cited here: https://bugzilla.mozilla.org/show_bug.cgi?id=1399937#c37

OK, thanks for letting me know, I will pass your information on to BB.

I'm not a developer, just a frustrated end user.

(In reply to Magnus Melin [:mkmelin] from comment #20)

While https://github.com/Betterbird/thunderbird-patches/blob/main/115/bugs/1829370-add-on-installation-non-focused-linux.patch "fixes" the non-working buttons it's disabling the security fix cited here: https://bugzilla.mozilla.org/show_bug.cgi?id=1399937#c37

Correct.

Basically just a rollback of https://hg.mozilla.org/mozilla-central/rev/34554df9f50c for Linux.
Note that the rollback was done in TB's (somewhat unmaintained) fork of that code (GlobalPopupNotifications.jsm was forked from Toolkit's PopupNotifications.jsm).
That's not optimal, since according to bug 1399937 comment #37 that code closes a potential vulnerability. It's unclear whether the vulnerability is present in TB and whether it's worth breaking add-on install to mitigate it.

All that said, we got Leo to try add-on install in Firefox and he reported that it's working despite:
https://searchfox.org/mozilla-central/rev/24ea2579c4a94d5da8db4bb529cbefe5e5e3c2d3/toolkit/modules/PopupNotifications.sys.mjs#1935-1942
which is the same code present in TB:
https://searchfox.org/comm-central/rev/f27f9eb40ed2d957d309b02f7540895b37427637/mail/modules/GlobalPopupNotifications.jsm#1522-1529

So a proper investigation is required to find out why the same code behaves differently in FF when compared to TB.

All,

Betterbird has officially released a new for 2024 update that includes this fix, minus the security issue/concern that was raised by Magnus Melin [:mkmelin].

I'm running the new version on my Chromebook Linux, and extensions/addons install normally and work!

There are instructions in the Support section for importing your Thunderbird profile into Betterbird. This way there is no need to start from scratch.

Leo.

The Thunderbird team is looking into this, but we decided to not roll back the security fix as a quick solution because we do not want to put a large group of our users at risk. We are aware that a small group of users is currently experiencing inconvenience and we want to assure you that we are looking for a proper solution.

(In reply to John Bieling (:TbSync) from comment #24)

The Thunderbird team is looking into this, but we decided to not roll back the security fix as a quick solution because we do not want to put a large group of our users at risk. We are aware that a small group of users is currently experiencing inconvenience and we want to assure you that we are looking for a proper solution.

My understanding is that this release does not compromise security as described here: https://bugzilla.mozilla.org/show_bug.cgi?id=1399937#c37

100% of people using Chromebook Linux suffer from this bug.

Please do review.

Thanks.

Please note that we took Magnus' criticism on board and revised the patch, so "putting a large group of users at risk" doesn't appear to be accurate. Additionally, the forked code in question has not been maintained in years and no security fixes have been backported from the original M-C version. Also note that bug 1343571, which introduced the code in the original M-C version, was not a "security bug".

My understanding is that this release does not compromise security as described here: https://bugzilla.mozilla.org/show_bug.cgi?id=1399937#c37

That comment states the exact opposite:

Just for the record, the "corner case fix" is an important security patch that prevents attackers from obtaining device permissions through phishy popup-windows. It should (and will) not be backed out under any circumstances.

I bought a Chromebook and was able to set up the environment with the help from Leo. I am able to confirm the bug (TB 115.7.0).

I will try to debug this.

Leo was able to install Firefox on the Chromebook and confirmed that it is working there. But that is the native version of Firefox, installed from the app store (I think that is a mobile version?) and not thru the penguin terminal / developer environment, right?

Has anybody been able to install firefox in the developer environment and if so, how?

Flags: needinfo?(Leowankerddd)

(In reply to John Bieling (:TbSync) from comment #29)

Leo was able to install Firefox on the Chromebook and confirmed that it is working there. But that is the native version of Firefox, installed from the app store (I think that is a mobile version?) and not thru the penguin terminal / developer environment, right?

Has anybody been able to install firefox in the developer environment and if so, how?

John,

I am not running the Google Play app store version of Firefox.
The version I have installed is from "Flatpak" https://flatpak.org/ is the info on Flatpak apps.

The software gets installed from https://flathub.org/apps/org.mozilla.firefox

First, make sure the Flatpak app platform is installed:
sudo apt install flatpak

To install the real Linux Mozilla Firefox run:

flatpak install flathub org.mozilla.firefox

To run from terminal:

flatpak run org.mozilla.firefox

Firefox will get added to the menu after a few minutes.

This will refresh the menu:
sudo update-desktop-database

Hope this helps.

Reach out if you run into any bumps.

Leo.

(In reply to John Bieling (:TbSync) from comment #29)

Leo was able to install Firefox on the Chromebook and confirmed that it is working there. But that is the native version of Firefox, installed from the app store (I think that is a mobile version?) and not thru the penguin terminal / developer environment, right?

Has anybody been able to install firefox in the developer environment and if so, how?

(In reply to John Bieling (:TbSync) from comment #28)

I bought a Chromebook and was able to set up the environment with the help from Leo. I am able to confirm the bug (TB 115.7.0).

I will try to debug this.

Hi John,

Just checking in to see if there has been any progress?

Thanks.

Flags: needinfo?(Leowankerddd)

Same problem for me, Thunderbird version 115.10.1 64-bit installed via Flatpak on ChromeOS version 123.0.6312.112.
Try to install any ad-on and neither the Add or Cancel buttons work.
The error console reports this:
PopupNotifications._onButtonEvent: Button click happened before the window was focused

Any progress on this? I run Gentoo, just updated to 115.10.1 (64-bit), and still unable to install.
How in the world with all the available testing methods does something that used to work no longer work in this day?!

This bug is mainly about ChromeOS and running Thunderbird inside the developer environment, which is a special kind of Linux with a weird window manager, which breaks Thunderbird. Currently we have no resources to fix this.

If you encounter this bug on a vanilla Gentoo (not on ChromeOS), could you please try Comment #10?

Summary: When Installing Addon, the pop up to 'Cancel' or 'Add' buttons not clickable - cannot install any Addon. "PopupNotifications._onButtonEvent: Button click happened before the window was focused." → [ChromeOS] When Installing Addon, the pop up to 'Cancel' or 'Add' buttons not clickable - cannot install any Addon. "PopupNotifications._onButtonEvent: Button click happened before the window was focused."

Some people managed to get the 'Add' button focused by clicking on the 'Tab' key on keyboard until it focused on the 'Add' button.
For anyone with this bug, please try that method.

I tried that, it doesn't work. Tab key does not seem to change focus when the popup is displayed.
I can click on the Add and Cancel buttons and see that they are triggered, but the popup does not close and the add-ins are not added.

No longer an issue with TB 128.

(In reply to john.g.davies from comment #37)

No longer an issue with TB 128.

I just tested with 130 beta version and yes, it seems to be resolved.

Thank you to whomever fixed the bug.

Does anybody have an idea of approximately when this version will reach the public? Not as a beta version.

Thanks.

Thunderbird 128 (stable) is out already.

(In reply to Magnus Melin [:mkmelin] from comment #39)

Thunderbird 128 (stable) is out already.

Thank you very much for confirming.

I will notify my users.

Even made an account for this:

Recent update to Thunderbird 128.2.0esr on my system did not change the issue at all.
The issue remains.

However I found another workaround:

(In reply to Anje from comment #35)

Some people managed to get the 'Add' button focused by clicking on the 'Tab' key on keyboard until it focused on the 'Add' button.
For anyone with this bug, please try that method.

This does not work for me, as the tab-key seems to have no effect.
But something similar worked.

The window has C for Cancel and A for Add (the plugin) underlined to mark as keyboard shortcuts for the window.
So I fiddled around a bit with the active focus and at one point apparently the key press went trough at some time. It may have even been when the window was the last focus, but not the active focus, by clicking into empty space/desktop.
Maybe it helps somebody still struggling.

Hi,

If you still can't use Extensions, you can do what I did.

On Chrome OS I have moved on from Thunderbird. There is a sister app called Betterbird.eu that works just fine. It uses the Thunderbird code base and has fixes that may not be in Thunderbird. This is one of them.

You don't even need to change anything. It read my TB profile.

Give it a try.

Hi,

I'm experiencing the same problem.

I use evilwm as window manager. I use focus follows mouse by implication.

I can't make a clean screenshot of this, but essentially, evilwm changes the border color in X around a window when it receives focus. If anybody can point at screen-grab-to-video I might be able to make a video to illustrate what I mean.

When the popup pops up, even if I hover the mouse over it, whilst the main window loses focus the popup does not receive focus (border remains grey rather than becoming yellow). The main window losing focus is normal and desired behaviour, the popup not receiving focus is confusing to say the least.

The specific section of code seems to be this (comm/mail/modules/GlobalPopupNotifications.sys.mjs):

1517       if (Services.focus.activeWindow != this.window) {
1518         Services.console.logStringMessage(
1519           "PopupNotifications._onButtonEvent: " +
1520             "Button click happened before the window was focused"
1521         );
1522         this.window.focus();
1523         return;
1524       }

Now here is the additional kicker, this.window.focus() for some reason I do not grasp sends the popup window to the background. I believe this may be because this.window refers the main application window rather than the popup. Which loses focus because the mouse moves out of the main window and into the popup window.

My understanding of window managers and the code around them isn't fresh, so this is from memory from a very, very long time ago. In Windows I believe an application receives focus, and this popup would be a modal popup (blocks other input into the main window) potentially. As such the main window will still report it has focus. In X11 and Xorg I believe the rules are different, and very much managed by various window managers for the most part rather than some fixed set of operating system rules. I've not used wayland nor do I have any experience with wayland.

In my environment the popup window should have the focus, not the main window. I've not investigated why evilwm doesn't change the border color for the popup when the focus shifts.

Regardless, as a temporary workaround I've commented the above (compile still running, will revert, and eventually recompile again with it uncommented as this seems to be security related) once I've managed to install the relevant plugins and confirmed they're working. Happy to assist with debugging here as in can probably add some Services.console.log(this.window) and Services.focus.activeWindow for starters to see what these are actually referring to at time of click. It's just a long recompile between changes, so would prefer a way to compile and run in-place and haven't checked if this is possible yet to avoid full recompiles between debug runs.

There seems to be a related piece of code in toolkit/modules/PopupNotifications.sys.mjs but I've not run into nor used that, but for reference. If anyone can advise when that variation would get triggered I can at the same time try to debug that too.

(In reply to Jaco Kroon from comment #43)

Hi,

I'm experiencing the same problem.

Hi,

I've never loaded a new window manager into the Chrome OS Linux container but I do know that this bug has been fixed in betterbird.eu

You can switch at any time and it will start working immediately and you can even use your existing Thunderbird profile.

I've been running betterbird on Chrome OS since January and it works perfectly with all extensions.

Can you please stop pitching betterbird so that those of us who are interested in the bug can actually make progress? Thanks bye.

Using Gentoo Linux here, with evilwm, and thunderbird compiled from source. So it's not Chrome OS, but does seem to be some aspects that creps into thunderbird, I've been trying to read how/what but have not managed to find authoritative information on it yet.

Thanks Jaco, having evilwm as a second window manager which fails (and which does not require a ChromeBook in order to be reproduced) is useful information. Any specific steps I need to follow to re-create your environment?

Attached file configure_log.txt
Hi John. Thanks for looking into this. Gentoo does seem to have a few extra patches (https://dev.gentoo.org/~juippis/mozilla/patchsets/firefox-128esr-patches-03.tar.xz). The maintainer (aka juippis) is IMHO very detail oriented so I doubt there'll be anything in there that'll break it (nor do I see anything specific in there that introduces obvious issues). Most of the patches seems to relate to using system-installed libraries rather than bundled, or enables compilation using MUSL. So unless you're patching some bundled package that implicitly and by accident fixes this ... Below is a fairly long extract from the initial configure which may highlight something to you. configure log: ``` >>> Configuring source in /var/tmp/portage/mail-client/thunderbird-128.3.1/work/thunderbird-128.3.1 ...
Hi John. Thanks for looking into this. Gentoo does seem to have a few extra patches (https://dev.gentoo.org/~juippis/mozilla/patchsets/firefox-128esr-patches-03.tar.xz). The maintainer (aka juippis) is IMHO very detail oriented so I doubt there'll be anything in there that'll break it (nor do I see anything specific in there that introduces obvious issues). Most of the patches seems to relate to using system-installed libraries rather than bundled, or enables compilation using MUSL. So unless you're patching some bundled package that implicitly and by accident fixes this ...

Hi John.

Thanks for looking into this.

Gentoo does seem to have a few extra patches (https://dev.gentoo.org/~juippis/mozilla/patchsets/firefox-128esr-patches-03.tar.xz).

The maintainer (aka juippis) is IMHO very detail oriented so I doubt there'll be anything in there that'll break it (nor do I see anything specific in there that introduces obvious issues). Most of the patches seems to relate to using system-installed libraries rather than bundled, or enables compilation using MUSL. So unless you're patching some bundled package that implicitly and by accident fixes this ...

I've attached the configure log that emerge produces, perhaps there is something in there that gives you more information.

I can't think of anything else that I'm doing "differently".

I note this now triple posted as I tried to add attachments and the like ... sorry about that.

I have confirmed that Services.focus.activeWindow == null in my use-case when the relevant code executes.

this.window is not, but I've no idea if that's referring to the topup or the main window.

OS: Unspecified → Android
See Also: → 1399937

In the just referenced 1399937, twm uses focus follows mouse.

More and more it seems to me at least like that's the common factor here.

The discussion about it more often than not failing on gnome is strange.

As a workaround, how easy would it be to allow to install plugins from the commandline?

eg thunderbird --install-plugin /path/to/file.xpi

But that probably also allows bypass in some way re-introducing the concern that resulted in this code in the first place.

Priority: -- → P1

GPG when it pops up with password prompts (when invoked from a git sub-process, by way of setting commit.gpgsign=true for the repository) has a way of locking the entire environment until I pay attention specifically to that dialog window. I'm not sure if that will also protect against the "input injection" that the code here is aiming to protect against, but might be worth a look.

I'm not sure how and exactly what gets invoked by git to trigger the GPG processing there, but I suspect they would have similar concerns.

Hi,

I encounter this bug using XFCE/X11 as desktop under a Debian testing (I only use LTS version provided by Debian, so no flatpak/own rebuild/whatever).

While playing with the XFCE's focus related options, I found one which makes it disappear. XFCE's folks name it "Honor standard ICCCM focus hint".

Hoping giving an hint to solve this bug...

Best regards

For the record, the original issue regarding ChromeBooks seems to be solved. I verified the issue existing in TB115, and that it is solved in TB128.10 and TB138.0.1.

There was also a significant change in how the window looked. In TB115 it had a black border, which was not the case in TB128. Overall, it looked a lot more natural in the unaffected versions.

The new reported fails are:

  • XFCE/X11 as desktop under a Debian testing
  • Gentoo Linux here, with evilwm, and thunderbird compiled from source

Any others?

I wonder how many different window managers exists and if this is going to be a never ending story ...

I am going to close this bug as WORKSFORME.

There is Bug 1907040 which is about Debian Testing. I will add a note about Gentoo with evilwm there and I invite those still affected to move to the other bug.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME

Even though I closed this bug, I do not know if everybody is moving over to the new bug dedicated to the recently reported issues. I am currently porting patches for the popup mechanism from upstream, and the patch for Bug 1966848 fixed the issue regarding evilWM for me. I have a try run, which allows you to download the patched build:

https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/CfxEo8fNRI2SLpaI_HJa9A/runs/0/artifacts/public/build/target.tar.xz

Execute:

tar xf target.tar.xz
cd thunderbird
./thunderbird

Does this fix the other reported issues as well? Please report in Bug 1907040. Thanks.

URL: 1907040
URL: 1907040
See Also: → 1907040
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: