From ca2b84af8f42663e5cba2af5bcb990f81d972ce0 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Sat, 25 Mar 2023 04:06:48 -0400 Subject: [PATCH] fx-compat: Disable macKeyset completely on non-Mac (#3044) --- chrome/content/zotero/platformKeys.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/platformKeys.js b/chrome/content/zotero/platformKeys.js index 34d9bdc6b1..265603a87f 100644 --- a/chrome/content/zotero/platformKeys.js +++ b/chrome/content/zotero/platformKeys.js @@ -43,9 +43,17 @@ window.addEventListener('DOMContentLoaded', () => { // Set behavior on all non-macOS platforms if (applicationMenu) applicationMenu.hidden = true; if (windowMenu) windowMenu.hidden = true; - // DEBUG: This doesn't disable Ctrl-Q, which shouldn't be active on Windows - // (fx102 follow-up to https://github.com/zotero/zotero/pull/3010) - if (macKeyset) macKeyset.disabled = true; + if (macKeyset) { + macKeyset.setAttribute('disabled', true); + // Keys display on menu items even when disabled individually, so just remove the relevant attributes + // Relevant platform code: + // https://searchfox.org/mozilla-central/rev/3ba3d0a57b6419206f82f80cd6c30faf59397664/toolkit/content/widgets/menu.js#295 + for (let key of macKeyset.querySelectorAll('key')) { + key.removeAttribute('modifiers'); + key.removeAttribute('keycode'); + key.removeAttribute('key'); + } + } if (isWin) { fileQuitItemUnix.hidden = true;