Extension can't fully capture key binding that's bound to accelerator key for Firefox menu?

Background information: I am trying to port my a recently created Chrome Extension to Firefox. I am using manifest v3 for the Firefox version of my extension. I have had to make minimal changes to the Chrome manifest.json to get the extension to load in Firefox: .background.service_worker => .background.scripts, added .browser_specific_settings.gecko.id and .browser_specific_settings.gecko.strict_min_version, .options_page => .options_ui.page, add .options_ui.open_in_tab set to true. With these changes, I am able to load the extension XPI into Firefox Developer Edition with signature verification disabled.

I have this code in the JavaScript that loads with my options page:

function checkForSaveKey(event) {
    if (event.isComposing || event.keyCode == 229 || !event.altKey)
    if (["s", "S"].includes(event.key))
document.addEventListener("keydown", checkForSaveKey);

This works fine on Chrome: when the user types Alt-s it saves the options just as if the user clicked the Save button (which is also bound to saveOptions()). However, on Firefox on Linux it executes my event handler as shown above, but then pulls up the History menu since the accelerator key for that menu is “s”. I tried adding event.stopPropagation() after the call to saveOptions() but that didn’t prevent the Firefox menu from popping up.

This is obviously not ideal. Is there any way to trap a key binding that’s also an accelerator key for a Firefox menu, so that the menu accelerator simply doesn’t work on this particular page? I don’t think changing the key I’m bound to is an acceptable solution here, given that then I’ll have to worry about what all the Firefox accelerator keys could be for any language a user of my extension is using.

sigh No help or suggestions from anyone for this?

You cannot override built-in shortcuts :frowning:. See this 23 YEARS old bug:

Alternatively, if you are looking for a fix only on your PC, you can hack it using " userChrome.js" file (similar to “userChrome.css”).

But I can’t tell how, but I’m sure it’s possible. This website will tell you more, although it’s a lot of reading: