A tiny browser extension (Chrome / Chromium / Firefox) that reverses the Enter behavior in the Abacus.AI ChatLLM chat box:
- Enter → inserts a newline (lets you write multi-line prompts comfortably)
- Shift + Enter → submits the prompt
This is useful when you write longer or more structured prompts and don’t want to accidentally send them by hitting Enter too early.
The extension injects a content script on the ChatLLM app (https://apps.abacus.ai/*) and:
- Locates the main chat textarea inside the element with
data-id="prependMsg". - Intercepts
keydownevents on that textarea:- Blocks the app’s default Enter behavior.
- On plain Enter:
- Manually inserts a
\nat the cursor position. - Dispatches an
inputevent so the React/Vue app updates its internal state.
- Manually inserts a
- On Shift + Enter:
- Prevents the newline.
- Triggers the same send action as clicking the send button (or calling the
ul()function when available).
Because the ChatLLM UI is a SPA and may render the textarea asynchronously, the script uses a combination of:
- A short polling loop on load (up to ~20 seconds)
- A
MutationObserverto re-attach if the textarea is recreated
- Clone this repository:
git clone https://github.com/cclambie/ChatLLM-Reverse-Enter.git cd ChatLLM-Reverse-Enter
- Open Chrome and go to:
chrome://extensions
- Turn on Developer mode (top-right toggle).
- Click "Load unpacked".
- Select the
ChatLLM-Reverse-Enterfolder.
The extension should now appear in your extensions list.
-
manifest.json
Chrome Manifest V3 definition for the extension. -
Matches
https://apps.abacus.ai/* -
Injects
content.jsas a content script atdocument_idle. -
content.js
Content script that: -
Finds the ChatLLM input textarea (
div[data-id="prependMsg"] textarea). -
Intercepts
keydownevents. -
Implements:
-
Enter → newline
-
Shift + Enter → submit (via send button /
ul())
- Make sure the extension is loaded.
- Open Abacus.AI ChatLLM (e.g.
https://apps.abacus.ai/chatllm/...). - In the chat input:
- Press Enter → a newline should be inserted (no message sent).
- Press Shift + Enter → the message should be submitted without adding a newline.
If it doesn't work, open DevTools → Console and look for log messages starting with SHIFTENTER: for debugging.
After making changes to manifest.json or content.js:
- Go to
chrome://extensions. - Click Reload on the
ChatLLM Reverse Enterextension. - Reload the ChatLLM tab.
You can add additional logging with console.log('SHIFTENTER: ...') in content.js to inspect behavior.
MIT