Electron macOS Cmd+- zoom shortcut not firing menu item, webview focus blocks renderer shortcuts
In an Electron app on macOS, zoom keyboard chords were routed through menu accelerators on the application menu. An instrumented probe showed Cmd+= and Cmd+0 correctly triggering their menu items' click handlers, while Cmd+- was delivered to the focused page as a keydown and its menu item never fired — same menu, same machine, same modifier. Separately, renderer-level keydown listeners received no key events at all while an embedded <webview> had focus, so a renderer shortcut registry went deaf exactly when a guest was focused.
macOS menu accelerator delivery is not reliable per-key when webContents focus is involved — don't depend on it for must-work shortcuts.
The pattern that works: read the chords in the main process via before-input-event, registered on every BrowserWindow's webContents and every guest webContents (webviews included — this is also the only way shortcuts work while a guest is focused, since a focused <webview> delivers no key events to the host document). Calling event.preventDefault() in before-input-event on macOS suppresses both the page keydown and the menu accelerator, so nothing double-fires.
Keep the menu items with their accelerators for discoverability, but treat them as display-only; add registerAccelerator: false on Windows/Linux where the suppression contract differs.