Originally created by: kristofferR
Caprine exposes a set of keyboard shortcuts via its native menus that Carrier doesn't have. Add a chosen subset of them, page-side in inject/messenger.js (same place as the existing chatRows() jump shortcuts) — no Carrier custom commands needed.
Implementation principle: facebook.com/messages is a minified React SPA we don't control. There is no exposed JS command for most of these actions — the logic lives inside React's internal event handlers with no callable global. So prefer the cleanest mechanism per action:
| Action | Key (mac / other) | Mechanism | Notes |
|---|---|---|---|
| Focus Text Input | ⌘L / Ctrl+L | direct JS | composer.focus() — plain DOM op |
| New Conversation | ⌘N / Ctrl+N | direct JS (try) | Navigate to the compose route if one exists; else click the "New message" button |
| Insert Emoji | ⌘E / Ctrl+E | click | Opens a React picker — no callable global |
| Insert GIF | ⌘G / Ctrl+G | click | Opens a React picker — no callable global |
| Attach Files | ⌘T / Ctrl+T | click | Composer attach/upload button |
| Search in Conversation | ⌘F / Ctrl+F | click (two-step) | Open the conversation info sidebar first, then click Search |
These Caprine shortcuts are intentionally left out for now:
Cmd/Ctrl+1–9 to jump to a conversationinject/messenger.js: [ / ] (back/forward), - / = / + / 0 (zoom), r (reload), F2 / F3 / F5, and Cmd/Ctrl+1–9 (jump to Nth conversation). None of the new keys collide with these.preventDefault() and verify there's no unwanted default behavior.shortcuts map (or a parallel handler) in src-tauri/inject/messenger.js..click() / .focus() it; bail quietly if not found (FB markup changes).MutationObserver / requestAnimationFrame, don't assume it's there synchronously).…) overflow on narrow widths. Open the parent control first, then click the target, and tolerate the button being absent.node --check inject/messenger.js.
Ticket changed by: kristofferR
Originally posted by: kristofferR
Implemented in PR [#42], page-side in inject/messenger.js per the mechanism table: Cmd/Ctrl+L focuses the composer (plain focus()), Cmd/Ctrl+E / G open Messenger's emoji/GIF pickers, Cmd/Ctrl+T clicks the attach button, and Cmd/Ctrl+F does the two-step search (opens the conversation-info sidebar when closed, then clicks its Search control once rendered — the control's aria-label is just "Search"). New Conversation deviates from the table: the native File menu already claimed ⌘N for New Window, so compose shipped as a File-menu item on Cmd/Ctrl+Shift+N instead (maintainer call), clicking the a[href="/messages/new/"] control. All selectors were verified against the live Messenger DOM via a new sanitized mcp-bridge probe. Existing shortcuts untouched except Cmd/Ctrl+[ / ] which now step conversations per [#18], and Hide Names & Avatars which moved to Cmd/Ctrl+Shift+H.
Related
Tickets:
#18Tickets:
#42