Tab context menu fluent strings not added if it's opened on all tabs menu before it's opened on tab browser
Categories
(Firefox :: Tabbed Browser, defect)
Tracking
()
People
(Reporter: aminomancer, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0
Steps to reproduce:
- Start firefox
- Don't right click the tab browser
- Open the all tabs menu
- Right click a tab in the all tabs menu
Actual results:
- Most context menus have no labels due to no fluent attributes
Expected results:
The function that sets up the fluent attributes is bound to a contextmenu event listener targeting the tab browser but not the all tabs menu. Event listeners should be added for the all tabs panel too.
If the FTL inserter function in tabbrowser.js was accessible from the all tabs panel's scope then it would be a lot easier. The function could be changed like this
this.tabContextFTLInserter = () => {
MozXULElement.insertFTLIfNeeded("browser/tabContextMenu.ftl");
// Un-lazify the l10n-ids now that the FTL file has been inserted.
document
.getElementById("tabContextMenu")
.querySelectorAll("[data-lazy-l10n-id]")
.forEach((el) => {
el.setAttribute("data-l10n-id", el.getAttribute("data-lazy-l10n-id"));
el.removeAttribute("data-lazy-l10n-id");
});
this.tabContainer.removeEventListener("contextmenu", this.tabContextFTLInserter, true);
this.tabContainer.removeEventListener("mouseover", this.tabContextFTLInserter);
this.tabContainer.removeEventListener("focus", this.tabContextFTLInserter, true);
};
this.tabContainer.addEventListener("contextmenu", this.tabContextFTLInserter, true);
this.tabContainer.addEventListener("mouseover", this.tabContextFTLInserter);
this.tabContainer.addEventListener("focus", this.tabContextFTLInserter, true);
and then the tabs panel could set up the same thing and remove the event listeners if it gets initialized first. in browser-allTabsMenu.js...
gTabsPanel = {
// ...
init() {
// ...
let lazies = document
.getElementById("tabContextMenu")
.querySelectorAll("[data-lazy-l10n-id]");
if (lazies) {
MozXULElement.insertFTLIfNeeded("browser/tabContextMenu.ftl");
lazies.forEach((el) => {
el.setAttribute("data-l10n-id", el.getAttribute("data-lazy-l10n-id"));
el.removeAttribute("data-lazy-l10n-id");
});
gBrowser.tabContainer.removeEventListener(
"contextmenu",
gBrowser.tabContextFTLInserter,
true
);
gBrowser.tabContainer.removeEventListener("mouseover", gBrowser.tabContextFTLInserter);
gBrowser.tabContainer.removeEventListener(
"focus",
gBrowser.tabContextFTLInserter,
true
);
}
},
};
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Disability Access APIs' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Updated•4 years ago
|
![]() |
||
Comment 2•4 years ago
|
||
In addition to the str Don't right click the tab browser
, it is necessary to Don't mouse over any tabs before right-clicking the tab entry in the lists all tabs
.
I can also reproduce on 78esr as well as 90.0a1.
Reporter | ||
Comment 3•4 years ago
|
||
Yeah sorry about that, the title looked like it was gonna be too long
Reporter | ||
Updated•3 years ago
|
Description
•