gh-13851: Fixed pressing u duplicating tabs (gh-13856)

This commit is contained in:
mr. m
2026-05-25 21:47:27 +02:00
committed by GitHub
parent 6f41ffe02d
commit 346219c3b4
3 changed files with 21 additions and 3 deletions

View File

@@ -358,4 +358,5 @@ zen-devtools-toggle-dom-shortcut = Toggle DOM
zen-devtools-toggle-accessibility-shortcut = Toggle Accessibility
zen-close-all-unpinned-tabs-shortcut = Close All Unpinned Tabs
zen-new-unsynced-window-shortcut = New Blank Window
zen-duplicate-tab-shortcut = Duplicate Tab
zen-duplicate-tab-shortcut = Duplicate Tab
zen-key-find-selection = Find Selection

View File

@@ -793,6 +793,7 @@ const zenMissingKeyboardShortcutL10n = {
key_selectTab7: "zen-key-select-tab-7",
key_selectTab8: "zen-key-select-tab-8",
key_selectLastTab: "zen-key-select-tab-last",
key_duplicateTab: "customkeys-file-duplicate-tab",
key_showAllTabs: "zen-key-show-all-tabs",
key_gotoHistory: "zen-key-goto-history",
@@ -801,6 +802,7 @@ const zenMissingKeyboardShortcutL10n = {
key_redo: "zen-key-redo",
key_inspectorMac: "zen-key-inspector-mac",
key_findSelection: "zen-key-find-selection",
// Devtools
key_toggleToolbox: "zen-devtools-toggle-shortcut",

View File

@@ -433,11 +433,14 @@ class KeyShortcut {
if (this.#keycode) {
key.setAttribute("keycode", this.#keycode);
key.removeAttribute("key");
} else {
} else if (this.#key) {
// note to "mr. macos": Better use setAttribute, because without it, there's a
// risk of malforming the XUL element.
key.setAttribute("key", this.#key);
key.removeAttribute("keycode");
} else {
key.removeAttribute("key");
key.removeAttribute("keycode");
}
key.setAttribute("group", this.#group);
@@ -845,7 +848,7 @@ class nsZenKeyboardShortcutsLoader {
}
class nsZenKeyboardShortcutsVersioner {
static LATEST_KBS_VERSION = 18;
static LATEST_KBS_VERSION = 19;
constructor() {}
@@ -1241,6 +1244,18 @@ class nsZenKeyboardShortcutsVersioner {
);
}
if (version < 19) {
// Migrate from version 18 to 19.
// Disable "key_duplicateTab" since we already had "cmd_zenDuplicateTab" before Firefox 151.
for (let shortcut of data) {
if (shortcut.getID() == "key_duplicateTab") {
shortcut.shouldBeEmpty = true;
shortcut.setDisabled(true);
break;
}
}
}
return data;
}
}