From c9fe95c00c3a90c172e23efe153236b630325458 Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 31 May 2025 22:16:05 +0200 Subject: [PATCH] closes #8713 - Fixed profile context menu not showing, c=common, t=fix --- src/browser/components/preferences/zen-settings.js | 4 ++-- src/zen/common/ZenUIMigration.mjs | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/browser/components/preferences/zen-settings.js b/src/browser/components/preferences/zen-settings.js index 36d06ffd4..d20c93970 100644 --- a/src/browser/components/preferences/zen-settings.js +++ b/src/browser/components/preferences/zen-settings.js @@ -1045,12 +1045,12 @@ var gZenCKSSettings = { const modifiersActive = modifiers.areAnyActive(); input.classList.remove(`${ZEN_CKS_INPUT_FIELD_CLASS}-not-set`); - + // First, try to read the *physical* key via event.code. // If event.code is like "KeyS", "KeyA", ..., strip off "Key" → "S". // Otherwise, fall back to event.key (e.g. "F5", "Enter", etc.). let shortcut; - if (event.code && event.code.startsWith("Key")) shortcut = event.code.slice(3); + if (event.code && event.code.startsWith('Key')) shortcut = event.code.slice(3); else shortcut = event.key; shortcut = shortcut.replace(/Ctrl|Control|Shift|Alt|Option|Cmd|Meta/, ''); // Remove all modifiers diff --git a/src/zen/common/ZenUIMigration.mjs b/src/zen/common/ZenUIMigration.mjs index 9a7428616..9b92518ed 100644 --- a/src/zen/common/ZenUIMigration.mjs +++ b/src/zen/common/ZenUIMigration.mjs @@ -3,6 +3,8 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. const lazy = {}; +var { AppConstants } = ChromeUtils.importESModule('resource://gre/modules/AppConstants.sys.mjs'); + ChromeUtils.defineESModuleGetters(lazy, { BrowserWindowTracker: 'resource:///modules/BrowserWindowTracker.sys.mjs', }); @@ -13,7 +15,11 @@ class ZenUIMigration { init(isNewProfile, win) { if (!isNewProfile) { - this._migrate(win); + try { + this._migrate(win); + } catch (e) { + console.error('ZenUIMigration: Error during migration', e); + } } this.clearVariables(); }