fx-compat: Disable macKeyset completely on non-Mac (#3044)

This commit is contained in:
Abe Jellinek 2023-03-25 04:06:48 -04:00 committed by GitHub
parent 2b3ee82d56
commit ca2b84af8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;