Chrome extension. Select text anywhere → right-click → gram → corrected text lands in your clipboard.
- Primary — ChatGPT temporary chat. Opens
chatgpt.com/?temporary-chat=true&q=<prompt + your text>. Theqparam pre-fills and auto-submits the prompt, so no DOM typing is needed. A content script waits for the reply to finish streaming, copies it to the clipboard, and the tab closes automatically. - Fallback — on-device AI. If ChatGPT doesn't respond within ~90s (login wall, UI change, network), the extension runs Chrome's built-in Prompt API (Gemini Nano) on the same text and copies that result instead. The ChatGPT tab is left open so you can see what went wrong.
- Either way you get a desktop notification telling you which path ran.
The prompt used:
Grammar check the following text. Make minimal changes and output only the corrected text, nothing else.
- Open
chrome://extensions - Enable Developer mode (top right)
- Load unpacked → select this folder
- Chrome 138+ (for the Prompt API fallback).
- Primary path works best when you're already logged in to chatgpt.com (temporary chat, so no history is saved).
- The fallback's on-device model downloads (~2 GB) on first use — until then a failed ChatGPT run may notify "on-device AI unavailable".
- The content script depends on ChatGPT's DOM (
data-message-author-role,data-testid="stop-button"). If OpenAI changes their UI, the primary path times out and the fallback takes over — the extension degrades, it doesn't break. - Very long selections can exceed URL length limits (~2k chars is safe).
| File | Role |
|---|---|
manifest.json |
MV3 manifest |
background.js |
Context menu, job state, fallback AI, notifications, tab lifecycle |
content.js |
Runs on chatgpt.com; scrapes the finished reply, copies it |
offscreen.html/js |
Clipboard writes from the service worker (fallback path) |