Explaina is an AI-powered Chrome extension that explains complex terms by analyzing the context of the page you're on. Select any word or phrase, and get a concise, context-aware explanation.
- Contextual Explanations: AI explains selected text using the surrounding page content.
- Two entry points: Right-click "Explain with AI" context menu, or select text and click the extension icon.
- Smart context extraction: Captures nearby paragraphs (up to 2000 chars) instead of the full page.
- Works everywhere: Content script injected into all websites.
- Streaming support: Displays responses incrementally when the backend supports it.
- Retry with backoff: Automatically retries on transient failures.
- Dark mode: Adapts to your system color scheme.
- Keyboard shortcut: Press
Ctrl+Shift+E(Cmd+Shift+Eon Mac) to open the popup. - Customizable API: Set a custom API URL via
chrome.storage.sync.
-
Clone the repository:
git clone https://github.com/yourusername/explaina.git cd explaina -
Install dependencies:
pnpm install pnpm approve-builds esbuild
-
Build the extension:
pnpm run build # compiles TypeScript src/ → dist/ pnpm run tailwind # compiles input.css → index.css
-
Load the extension into Chrome:
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
explainadirectory
- Open
- Select text → right-click → "Explain with AI" — quick entry from context menu.
- Select text → click extension icon — popup opens with text pre-filled.
- Press
Ctrl+Shift+E— opens the popup instantly. - Edit the text in the popup textarea, then click Explain.
pnpm run dev # watch mode — rebuilds on file changes
pnpm run tailwind # rebuild CSS after theme changesexplaina/
├── src/ # TypeScript source files
│ ├── background.ts # Service worker (context menu)
│ ├── content.ts # Content script (text selection)
│ ├── popup.ts # Popup UI logic
│ └── types.ts # Shared type definitions
├── dist/ # Compiled JS output (gitignored)
├── input.css # Tailwind CSS input
├── index.css # Compiled CSS (gitignored)
├── manifest.json # Chrome extension manifest
├── popup.html # Popup UI
├── tsconfig.json # TypeScript config
└── package.json # Dependencies & build scripts
Set a custom endpoint via the console:
chrome.storage.sync.set({ apiUrl: "https://your-server.com/api/explain" })ISC