The "Translate this page?" pop-up appears in front of the "default browser" pop-up, but the focus goes to the "default browser" pop-up
Categories
(Firefox :: Translations, defect, P3)
Tracking
()
People
(Reporter: danibodea, Unassigned, Mentored)
Details
Attachments
(1 file)
|
9.22 MB,
video/webm
|
Details |
Note
- When the user launches the browser and both the default browser and Translate this page modals get displayed, the default browser modal has the focus even if the other one is in front of it.
Found in
- Beta v118.0b6
Affected versions
- Beta v118.0b6
Tested platforms
- Affected platforms: Windows 10
- Unaffected platforms: ?
Steps to reproduce
- Open a new profile
- Load a page that has another default language than the browser
(This would cause the "Translate this page?" modal to be displayed) - Close the browser and reopen the same user profile.
- When the browser reopens, it will display both the "Translate this page" modal and the "default browser" modal.
Expected result
- The pop-up that is displayed in front should have the focus to interact with it.
Actual result
- The "Translate this page?" pop-up appears in front of the "default browser" pop-up, but the focus goes to the "default browser" pop-up.
Regression range
- appears to be an issue since the implementation of the "Translate this page?" modal.
Additional notes
- additional_note1
Comment 1•2 years ago
|
||
:danibodea, if you think that's a regression, could you try to find a regression range using for example mozregression?
Comment 2•2 years ago
|
||
The severity field is not set for this bug.
:gregtatum, could you have a look please?
For more information, please visit BugBot documentation.
Comment 3•2 years ago
|
||
I started looking at this, but haven't had time to get a proper fix going, someone could take it over. It will probably need a test.
diff --git a/browser/components/translations/content/translationsPanel.js b/browser/components/translations/content/translationsPanel.js
index 2e81bdc7df50e..4c32094379453 100644
--- a/browser/components/translations/content/translationsPanel.js
+++ b/browser/components/translations/content/translationsPanel.js
@@ -1449,7 +1449,12 @@ var TranslationsPanel = new (class {
handleEvent = async event => {
switch (event.type) {
case "TranslationsParent:OfferTranslation": {
- if (Services.wm.getMostRecentBrowserWindow()?.gBrowser === gBrowser) {
+ if (
+ Services.wm.getMostRecentBrowserWindow()?.gBrowser === gBrowser &&
+ !(await TranslationsPanel.isBrowserShowingNotification(
+ gBrowser.selectedBrowser.browsingContext.currentWindowGlobal
+ ))
+ ) {
this.open(event, /* reportAsAutoShow */ true);
}
break;
@@ -1605,3 +1610,8 @@ XPCOMUtils.defineLazyPreferenceGetter(
"browser.translations.panelShown",
false
);
+
+ChromeUtils.defineESModuleGetters(TranslationsPanel, {
+ isBrowserShowingNotification:
+ "resource:///modules/UrlbarProviderSearchTips.sys.mjs",
+});
diff --git a/browser/components/urlbar/UrlbarProviderSearchTips.sys.mjs b/browser/components/urlbar/UrlbarProviderSearchTips.sys.mjs
index adba886f2c69c..30095572a243a 100644
--- a/browser/components/urlbar/UrlbarProviderSearchTips.sys.mjs
+++ b/browser/components/urlbar/UrlbarProviderSearchTips.sys.mjs
@@ -491,7 +491,7 @@ class ProviderSearchTips extends UrlbarProvider {
}
}
-async function isBrowserShowingNotification(window) {
+export async function isBrowserShowingNotification(window) {
// urlbar view and notification box (info bar)
if (
window.gURLBar.view.isOpen ||
Comment 6•2 years ago
|
||
Hi, I would like to work on this.
Comment 7•2 years ago
•
|
||
We have lots of outreachy applicants right now, so we are assigning bugs once viable patches are attached.
Comment 8•2 years ago
|
||
Hi I am having an issue replicating this bug on Nightly sadly it doesn't show the default browser pop-up.
First i opened a browser tab to a page that is in Spanish (my default browser language is English) it does show the Translate Page pop-up then i close Nightly and re-open by running mach run it only shows the Translate Page pop-up nothing else. Or is there anything i am missing ?
| Reporter | ||
Comment 9•2 years ago
|
||
I am sorry, I missed a step in the original description. To answer your question, the Default Browser should be displayed the second time you open a NEWLY created profile. Here are the whole steps:
Steps to reproduce
- Open the browser using a newly created profile info
- Load a page that has another default language than the browser (link for a page in German)
(This would cause the "Translate this page?" modal to be displayed) - Check the "Open previous windows and tabs" in about:preferences and close this page.
- Make sure the page in step 2 is in focus, then close the browser and reopen the same user profile.
- When the browser reopens, it will display both the "Translate this page" modal and the "default browser" modal.
Expected result
The pop-up that is displayed in front should have the focus to interact with it.
Actual result
The "Translate this page?" pop-up appears in front of the "default browser" pop-up, but the focus goes to the "default browser" pop-up.
Comment 10•10 months ago
|
||
Hello everyone, I tried to reproduce this bug on macOS (darwin 24.3.0) but found different behavior than reported:
Steps taken to reproduce:
- Created a new profile and launched Firefox
- Loaded www.mozilla.org/de/ (German page)
- Got both popups to appear:
- Translation popup in front
- Default browser notification behind
Observed behavior:
- Translation popup appears visually in front (correct)
- Keyboard focus stays within the translation popup:
- Tab key navigation shows blue highlights around buttons
- Focus moves between "Cancel" and "Translate" buttons
- Focus does not move to the default browser popup behind
- Default browser notification stays behind and doesn't receive focus
This seems to be working as intended, with proper focus management. Could this bug have been fixed in a recent update? Or are there specific steps I'm missing to reproduce the focus issue?
Environment:
- OS: macOS (darwin 24.3.0)
- Firefox: Nightly build
Comment 11•10 months ago
|
||
It very much could have, it's probably worth getting one other confirmation that it's fixed. I don't have the time at the moment. The reporter was on Windows, so that may be good to verify before closing. I guess I was able to reproduce awhile back.
Comment 12•10 months ago
|
||
Hello, I just tested this on Windows 10 using Firefox 139.0a1 and 138.0b3. I did not reproduce the bug.
Steps followed:
- Created a new profile and launched it in a new browser
- Loaded www.mozilla.org/de/
- Enabled "Open previous windows and tabs"
- Closed the window and re-launched the profile
Behavior observed:
- Both the translation and default browser popups appeared, with the translation popup on top as in the previously attached video
- The tab key cycles through translation popup buttons and fields in top-to-bottom, left-to-right order, looping back to the settings button when tabbing from "Cancel"
- Clicking around in the translation popup had not effect on the default browser popup
This all seems to be desired behavior, except that it may be more sensible for the default browser popup to appear over the translation popup, since the former prevents interaction with the rest of the window.
Comment 13•10 months ago
|
||
I have also tried reproducing the issue but am unable to reproduce it. I think it may have been fixed
Comment 14•10 months ago
|
||
Resolving as fixed, we can re-open if needed.
Description
•