Highlight code blocks and get an explanation from an AI model running directly in your browser! This browser extension works across multiple browsers including Chrome, Firefox, Edge, Safari, Brave, and DuckDuckGo.
- Browser-Based AI: AI models run directly in your browser - no server setup required! π
- Cross-Browser Support: Compatible with Chrome, Firefox, Edge, Safari, Brave, and DuckDuckGo
- Simple Selection: Hold Shift + drag to select any code or UI element on a webpage
- GPU Acceleration: Uses WebGPU/WebGL for fast inference on all GPUs including older hardware
- Complete Privacy: All processing happens in your browser - no data ever leaves your device
- Offline Capable: Works offline after the first model download
- Secure: Includes XSS protection and follows browser security best practices
- Clone this repository
- Open your browser and navigate to the extensions page:
- Chrome:
chrome://extensions/ - Edge:
edge://extensions/ - Brave:
brave://extensions/
- Chrome:
- Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the extension directory
- The extension is now installed and ready to use!
- Clone this repository
- Open Firefox and navigate to
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on"
- Select the
manifest.jsonfile from the extension directory - The extension is now installed temporarily (will be removed when Firefox restarts)
For permanent installation in Firefox, you'll need to package and sign the extension through AMO (addons.mozilla.org).
-
Convert to Safari Extension:
# macOS only - requires Xcode Command Line Tools xcrun safari-web-extension-converter /path/to/extension --app-name "LearnByHover"
-
Build and Run:
- Open the generated Xcode project
- Build and run the project (Cmd+R)
- Enable the extension in Safari:
- Open Safari β Preferences β Extensions
- Enable "LearnByHover"
- Grant necessary permissions
-
For Development:
- Keep the Xcode project running while testing
- Reload the extension after making changes
Note: Safari requires extensions to be wrapped in a macOS app. The safari-web-extension-converter tool creates this wrapper automatically.
The DuckDuckGo browser for desktop and mobile supports web extensions:
Desktop (macOS/Windows):
- DuckDuckGo browser uses the same extension installation as Chromium-based browsers
- Navigate to the extensions page or settings
- Follow the same steps as Chrome/Brave installation above
Mobile: DuckDuckGo mobile browser has limited extension support. Currently, the extension requires desktop browser APIs (tabs, screenshot capture) that are not available on mobile browsers.
π No Setup Required!
The extension now uses browser-based AI models that run directly in your browser. Just install the extension and you're ready to go!
On your first use, the extension will:
- Download the AI model (~80-500MB depending on the model chosen)
- Cache it in your browser for future use
- This only happens once - subsequent uses are instant!
If you prefer to use the original Python backend with Ollama:
- Open the extension settings (click the extension icon or go to options)
- Change "Inference Mode" to "Backend Mode (Legacy)"
- Follow the backend setup instructions below
- Install Ollama: Follow instructions at https://ollama.ai
- Pull the model:
ollama pull moondream:1.8b
- Install Python dependencies:
pip install fastapi uvicorn pillow ollama python-multipart
- Start the backend:
The server will run on http://127.0.0.1:8000
python backend.py
- Navigate to any webpage with code
- Hold Shift and drag your mouse to select the code area
- Release the mouse to capture the selection
- Wait for the AI-powered explanation to appear in a floating panel
- You can ask up to 3 questions per page load
- First Use: 15-60 seconds (model download + initialization)
- Subsequent Uses: 2-5 seconds (model cached, instant load)
- Hardware Acceleration: Uses WebGPU/WebGL for GPU acceleration
- Works on: All modern GPUs including older hardware like Intel Iris Xe
- Inference Time: 8-12 seconds per query
- Requires: Python backend running locally
- Hardware: Depends on Ollama performance
- Content Security Policy (CSP): Prevents unauthorized script execution
- XSS Protection: All user-generated content is sanitized before display
- Browser-Based Processing: All AI inference happens in your browser (no external servers)
- Minimal Permissions: Only requests necessary browser permissions
This extension prioritizes your privacy. All code analysis is performed entirely in your browser. No data ever leaves your device. See our Privacy Policy for details.
| Browser | Version | Support Status | AI Acceleration |
|---|---|---|---|
| Chrome | 113+ | β Fully supported | WebGPU + WebGL |
| Edge | 113+ | β Fully supported | WebGPU + WebGL |
| Brave | 1.52+ | β Fully supported | WebGPU + WebGL |
| Firefox | 118+ | β Fully supported | WebGL |
| Safari | 16+ | β Fully supported | WebGL |
| DuckDuckGo Desktop | Latest | β Fully supported | WebGPU + WebGL |
| DuckDuckGo Mobile | N/A | β Not supported | N/A |
The extension uses Transformers.js to run vision-language models directly in your browser:
- Model: ViT-GPT2 image captioning (quantized for efficiency)
- Inference: WebGPU/WebGL acceleration for fast processing
- Caching: Models cached in IndexedDB after first download
- Privacy: All processing happens locally in your browser
The extension uses Manifest V3 format for maximum compatibility and security. It includes:
- Cross-browser API support (works with both
chromeandbrowsernamespaces) - Service worker-based background script
- Web Workers for non-blocking AI inference
- Content security policy for WebAssembly and WebGPU
- Proper icon assets
- Browser-Based Mode: Wait for the model to download on first use (progress shown in loading panel)
- Backend Mode: Ensure the backend server is running on http://127.0.0.1:8000
- Check browser console for error messages
- Verify all permissions are granted
- Check your internet connection
- Try reloading the page
- Clear browser cache and try again
- Switch to backend mode in settings as fallback
- Ensure you've built and run the Xcode wrapper project
- Check that the extension is enabled in Safari Preferences
- Grant all requested permissions when prompted
- First use requires model download (one-time)
- Ensure WebGL/WebGPU is enabled in your browser
- Try closing other tabs to free up memory
- Switch to Florence-2-base model (smaller, faster) if available
For technical details about the migration from backend to browser-based inference, see MIGRATION_EVALUATION.md.
This project is licensed under the MIT License - see the LICENSE file for details.
For information about data collection and privacy, see our Privacy Policy.