diff --git a/mail/base/content/mailWindow.js b/mail/base/content/mailWindow.js index 330eb473b6..02259b3255 100644 --- a/mail/base/content/mailWindow.js +++ b/mail/base/content/mailWindow.js @@ -299,12 +299,9 @@ function InitMsgWindow() { } }, }; - Services.els.addSystemEventListener( - document, - "keypress", - keypressListener, - false - ); + document.addEventListener("keypress", keypressListener, { + mozSystemGroup: true, + }); } // We're going to implement our status feedback for the mail window in JS now. diff --git a/mail/components/customizableui/CustomizableUI.sys.mjs b/mail/components/customizableui/CustomizableUI.sys.mjs index 534ede9d04..d855ee3114 100644 --- a/mail/components/customizableui/CustomizableUI.sys.mjs +++ b/mail/components/customizableui/CustomizableUI.sys.mjs @@ -20,8 +20,8 @@ var gPanelsForWindow = new WeakMap(); var CustomizableUIInternal = { addPanelCloseListeners(aPanel) { - Services.els.addSystemEventListener(aPanel, "click", this, false); - Services.els.addSystemEventListener(aPanel, "keypress", this, false); + aPanel.addEventListener("click", this, { mozSystemGroup: true }); + aPanel.addEventListener("keypress", this, { mozSystemGroup: true }); const win = aPanel.ownerGlobal; if (!gPanelsForWindow.has(win)) { gPanelsForWindow.set(win, new Set()); @@ -30,8 +30,8 @@ var CustomizableUIInternal = { }, removePanelCloseListeners(aPanel) { - Services.els.removeSystemEventListener(aPanel, "click", this, false); - Services.els.removeSystemEventListener(aPanel, "keypress", this, false); + aPanel.removeEventListener("click", this, { mozSystemGroup: true }); + aPanel.removeEventListener("keypress", this, { mozSystemGroup: true }); const win = aPanel.ownerGlobal; const panels = gPanelsForWindow.get(win); if (panels) {