can't install any extension. Permission dialog fails on WSL Ubuntu (because browser window is never the focus manager's `activeWindow`)
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
People
(Reporter: parser75, Unassigned)
References
Details
Attachments
(1 file)
|
74.68 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0
Steps to reproduce:
Symptom: find any extension which is good to install, click "add to firefox". A pop up showing the permissions and cancel/add is displayed, but both buttons cannot be pressed, the dialog won't disappear unless the page is reloaded. The same happens after RMB on "add to firefox" and subsequent Addons|Install addon from file on the downloaded xpi file.
openSuse 15.1 with KDE3.5
I cleared my ~/.mozilla and ¨/.cache/mozilla, created a new profile.. no difference to my old profile. I think the issue is much older (anything in the Leap range of versions), but previously I didn't care for it.
Actual results:
In the browser console any click on the buttons returns this error:
Sending message that cannot be cloned. Are you trying to send an XPCOM object? addonManager.js:262:13
PopupNotifications._onButtonEvent: Button click happened before the window was focused
Sending message that cannot be cloned. Are you trying to send an XPCOM object? addonManager.js:262:13
PopupNotifications._onButtonEvent: Button click happened before the window was focused
Trying to click into the popup window to make it focused does not work. All attempts to use keyboard shortcuts (the underlined characters, tab, esc etc.) don't do anything.
Expected results:
Obviously, the buttons should react.
I found a workaround:
My KDE window settings were set to "Focus strictly under mouse". Changing it to "Click to Focus" solves this error (but is not an option to work with). Fortunately, "Focus under Mouse" still seems to do the job (but leaves me clueless which differences to expect outside FF)
This bug is back in version 128. Observed on: wsl ubuntu firefox
Comment 1•1 year ago
|
||
This looks like it could be a bug in our PopupNotifications security delay code. If the buttons don't work and this error is logged It's unlikely to be directly related to webextension code.
I don't think this is a sec bug. I'll try to reproduce it.
Updated•1 year ago
|
I had installed firefox on wsl using this guide:
https://support.mozilla.org/en-US/kb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributions
And there you can reproduce this problem immediately.
And when hovering the mouse over the cancel and add buttons, they change colors. Only clicking on them does not work.
Comment 4•1 year ago
|
||
I couldn't reproduce this on Ubuntu directly and WSL does not work in my Windows 11 VM. Gijs, do you happen to have a WSL installation already and could try to reproduce?
If you tell me where to look for the log and in the log what message to look for, I can help you.
Comment 6•1 year ago
|
||
(In reply to parser75 from comment #2)
I had installed firefox on wsl using this guide:
https://support.mozilla.org/en-US/kb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributionsAnd there you can reproduce this problem immediately.
I just tried this on WSL on a bare-metal Windows installation. I set it up with the instructions provided and I can interact with permission prompts including the addon installation one just fine.
I'm not sure if we support running Firefox in WSL. I'm curious why you don't run it natively?
Updated•1 year ago
|
Because in the company Win11 laptop Firefox is blocked.
And the only way to have it is in WSL.
Comment 8•1 year ago
|
||
What WSL do you have, i.e. what does wsl -l -v say? If it says version 1, you should try version 2 where compatibility is much better.
wsl -l -v
NAME STATE VERSION
- Ubuntu-24.04 Running 2
Comment 10•1 year ago
|
||
Just to double check: it seems you created this bug by cloning bug 1625798, but does the original report exactly fit your case? i.e. you also see the same error messages on the browser console?
(And it seems bug 1625798 is duped to bug 1399937 which is still open.)
| Reporter | ||
Comment 11•1 year ago
|
||
I see following error message in the console when trying to click one of the buttons:
PopupNotifications._onButtonEvent: Button click happened before the window was focused / active
Yes, I cloned this ticket from 1625798, as the the described steps to reproduce do match exactly.
Comment 12•1 year ago
•
|
||
Okay, I have WSL Ubuntu and I can repro this. Actually it seems the exact issue I had while debugging geolocation on WSL.
Can you try the below:
- Open https://mylocation.org/
- Click "Browser Geolocation"
- Click "Start Test"
- Try clicking either "Block"/"Allow" on the permission prompt
- See whether the same
PopupNotifications._onButtonEvent: Button click happened before the window was focused / activehappens
If yes I think I'll rename this to popup notification focus issue.
(This doesn't happen on Hyper-V Ubuntu)
| Reporter | ||
Comment 13•1 year ago
|
||
I did all 5 steps, and yes the same message came when clicking either Block/Allow:
PopupNotifications._onButtonEvent: Button click happened before the window was focused / active
And the click is not accepted.
Comment 14•1 year ago
|
||
(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #12)
- Try clicking either "Block"/"Allow" on the permission prompt
At this point, in the browser console, if you log (from https://searchfox.org/mozilla-central/rev/de46cd99a7d1634058b511a3f546a970763e5048/toolkit/modules/PopupNotifications.sys.mjs#1939-1941 )
Services.focus.activeWindow == window
and
document.querySelector("panel[panelopen] popupnotification").matches(":-moz-window-inactive")
what do those print?
Comment 15•1 year ago
|
||
(note that you'd likely need to print them from a timeout/interval to make sure the window + panel are focused, not the browser console... but it's confusing that something thinks the window/panel doesn't have focus. That seems likely to be a widget problem of sorts.)
| Reporter | ||
Comment 16•1 year ago
|
||
Content-Security-Policy: The page’s settings blocked an inline style (style-src-attr) from being applied because it violates the following directive: “default-src chrome: resource:” panel.js:62:23
Content-Security-Policy: The page’s settings blocked an inline style (style-src-attr) from being applied because it violates the following directive: “default-src chrome: resource:” 2 customElements.js:499:25
Content-Security-Policy: The page’s settings blocked an inline style (style-src-attr) from being applied because it violates the following directive: “default-src chrome: resource:” panel.js:62:23
Content-Security-Policy: The page’s settings blocked an inline style (style-src-attr) from being applied because it violates the following directive: “default-src chrome: resource:” 2 customElements.js:499:25
Content-Security-Policy: The page’s settings blocked an inline style (style-src-attr) from being applied because it violates the following directive: “default-src chrome: resource:” panel.js:62:23
PopupNotifications._onButtonEvent: Button click happened before the window was focused / active
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
| Reporter | ||
Comment 19•1 year ago
|
||
Sorry for the triple message. I don't know how to delete one. Also I didn't find how to attach a little screenshot.
Comment 20•1 year ago
|
||
(In reply to parser75 from comment #19)
Sorry for the triple message. I don't know how to delete one. Also I didn't find how to attach a little screenshot.
I've hidden the duplicates. You can attach a screenshot by clicking "Attach New File" in the "Attachments" section at the top of the bug.
Comment 21•1 year ago
|
||
(In reply to :Gijs (he/him) from comment #14)
I'm so happy that devtools has logging feature nowadays so I don't have to worry about focus change 🙂
Services.focus.activeWindow is null, this.window is ChromeWindow of chrome://browser/content/browser.xhtml, document.querySelector("panel[panelopen] popupnotification").matches(":-moz-window-inactive") is false.
Comment 22•1 year ago
|
||
setTimeout also reports null when I repeatedly click the popup notification, so I think it just never becomes activeWindow at all?
Comment 23•1 year ago
•
|
||
WSL also shows a weird issue that if you maximize the Browser Toolbox while keeping the Firefox window non-maximized, the mouse cursor sees-through the Firefox window (i.e. any mouse activity goes to Browser Toolbox even if the Firefox window is the most foreground window).
Edit: it doesn't have to be Browser Toolbox, maximize any WSL window and it causes the same bug. It doesn't even have to be Firefox, it can be Chrome. But Chrome itself doesn't have this issue.
Comment 24•1 year ago
|
||
Could this be anything to do with bug 1869891 and bug 1894328?
| Reporter | ||
Comment 25•1 year ago
|
||
| Reporter | ||
Comment 26•1 year ago
|
||
I was expecting that the
default-src chrome
was not matching the moz-window.
But just a guess.
Comment 27•1 year ago
|
||
Unlikely, popups are very different beasts from notification windows.
Comment 28•1 year ago
|
||
This can't be fixed in the notifications code; if activeWindow is wrong other things will also not work well.
Comment 29•1 year ago
|
||
(this might need to live and be fixed in gtk widget instead, but I don't know enough about focus / Linux widget / WSL to determine if that's the case or not)
Description
•