A Chrome extension that provides instant AI explanations and translations for any selected text on web pages. Designed with a minimal, modern black-and-white aesthetic, it integrates seamlessly into your browsing experience.
- Text Selection Detection: Automatically detects when you select text on any webpage.
- Dual Action Popup: A minimal black pill appears near your selection offering two options:
- Explain: Get clear, educational explanations with context.
- Translate: Get detailed translations with examples, idioms, and usage context.
- Rich AI Responses:
- Markdown formatting.
- Syntax highlighting for code.
- RTL (Right-to-Left) text support for languages like Arabic, Persian, and Hebrew.
- Supported LLM Providers:
- OpenRouter (API Key) - Access Claude, GPT-4, Llama 3, and more.
- Gemini (API Key) - Use Google's Gemini models (Free tier available).
- Modern Minimal UI: sleek black & white interface inspired by modern design systems (shadcn/ui).
- Customizable: Configure your preferred language, model, and system prompts.
- Clone or download this repository.
- Generate the icons (requires Node.js):
node scripts/generate-icons.js
- Open Chrome and navigate to
chrome://extensions/. - Enable "Developer mode" in the top right corner.
- Click "Load unpacked" and select the extension directory (
explain-anything). - The extension is now installed!
- After installation, the settings page should open automatically. (If not, click the extension icon and select "Settings").
- Select a Provider:
- OpenRouter: Great for accessing a wide variety of models. Get a key at openrouter.ai/keys.
- Gemini: Excellent free tier options. Get a key at aistudio.google.com/app/apikey.
- Enter API Key: Paste your key into the corresponding field.
- Select Model: Choose the AI model you want to use (e.g.,
gemini-1.5-flash,anthropic/claude-3-haiku). - Set Language: Choose the language you want the AI to respond in.
- Click "Save Settings".
- Select Text: Highlight any text on a webpage.
- Choose Action: A small black popup will appear next to your cursor with two icons:
- Left Icon (Sparkles): Explain the selected text.
- Right Icon (Translate): Translate the selected text.
- View Result: A clean modal will open displaying the AI's response.
- Copy: Click the copy icon to save the response to your clipboard.
- Close: Click the close icon (X), click outside the modal, or press
Esc.
explain-anything/
├── manifest.json # Extension manifest (V3)
├── src/
│ ├── content/ # Content script (UI, selection logic)
│ ├── background/ # Service worker (API handling)
│ ├── options/ # Settings page
│ └── providers/ # API integrations (Gemini, OpenRouter)
├── assets/ # Icons
├── scripts/ # Utility scripts
└── README.md
- No Data Collection: The extension does not collect or track your browsing data.
- Direct Communication: Selected text is sent directly from your browser to your chosen LLM provider (OpenRouter or Google) solely for the purpose of generating the response.
- Local Storage: Your API keys and settings are stored locally in your browser's sync storage.
MIT License - Feel free to modify and distribute.