diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /toolkit/components/extensions/ExtensionShortcuts.sys.mjs | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/extensions/ExtensionShortcuts.sys.mjs')
-rw-r--r-- | toolkit/components/extensions/ExtensionShortcuts.sys.mjs | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/toolkit/components/extensions/ExtensionShortcuts.sys.mjs b/toolkit/components/extensions/ExtensionShortcuts.sys.mjs index 17cff67eb9..e800fcc22d 100644 --- a/toolkit/components/extensions/ExtensionShortcuts.sys.mjs +++ b/toolkit/components/extensions/ExtensionShortcuts.sys.mjs @@ -261,7 +261,24 @@ export class ExtensionShortcuts { if (storedCommand && storedCommand.value) { commands.set(name, { ...manifestCommands.get(name) }); + lazy.ExtensionSettingsStore.removeSetting(extension.id, "commands", name); + if ( + name === "_execute_action" && + extension.manifestVersion > 2 && + lazy.ExtensionSettingsStore.hasSetting( + extension.id, + "commands", + "_execute_browser_action" + ) + ) { + lazy.ExtensionSettingsStore.removeSetting( + extension.id, + "commands", + "_execute_browser_action" + ); + } + this.registerKeys(commands); } } @@ -285,6 +302,19 @@ export class ExtensionShortcuts { let savedCommands = await this.loadCommandsFromStorage(extension.id); savedCommands.forEach((update, name) => { let command = commands.get(name); + if ( + name === "_execute_browser_action" && + extension.manifestVersion > 2 + ) { + // Ignore the old _execute_browser_action if there is data stored for + // the new _execute_action command. Otherwise use the stored data for + // `_execute_action` (since we renamed `_execute_browser_action` to + // `_execute_action` in MV3). + command = savedCommands.has("_execute_action") + ? null + : commands.get("_execute_action"); + } + if (command) { // We will only update commands, not add them. Object.assign(command, update); @@ -419,7 +449,7 @@ export class ExtensionShortcuts { } doc.documentElement.appendChild(keyset); if (sidebarKey) { - window.SidebarUI.updateShortcut({ keyId: sidebarKey.id }); + window.SidebarController.updateShortcut({ keyId: sidebarKey.id }); } this.keysetsMap.set(window, keyset); } |