Bug 1555453 - use contextmenu event as backup to ensure we always localize the context menu, r=jaws a=jcristau
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 31 May 2019 20:01:56 +0000
changeset 536677 836d74518ab6cda03a43f40b1824168875cd97d9
parent 536676 3bafa11dbad5d24a59712b5c91d844af953c0570
child 536678 00203ea1541d75cb3d7d30096daa365682a1b7b9
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, jcristau
bugs1555453
milestone68.0
Bug 1555453 - use contextmenu event as backup to ensure we always localize the context menu, r=jaws a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D33328
browser/base/content/tabbrowser.js
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -4783,19 +4783,21 @@ window._gBrowser = {
 
     let 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", tabContextFTLInserter, true);
       this.tabContainer.removeEventListener("mouseover", tabContextFTLInserter);
       this.tabContainer.removeEventListener("focus", tabContextFTLInserter, true);
     };
+    this.tabContainer.addEventListener("contextmenu", tabContextFTLInserter, true);
     this.tabContainer.addEventListener("mouseover", tabContextFTLInserter);
     this.tabContainer.addEventListener("focus", tabContextFTLInserter, true);
   },
 
   setSuccessor(aTab, successorTab) {
     if (aTab.ownerGlobal != window) {
       throw new Error("Cannot set the successor of another window's tab");
     }