A browser extension that lets you summarize any webpage and ask questions using AI.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

agents.md and readme.md for initial publish

+59 -74
+10 -5
AGENTS.md
··· 1 1 # AGENTS.md 2 2 3 3 ## Project Type 4 - Chrome Extension (Manifest V3) - vanilla JS/HTML/CSS, no build step. 4 + Browser Extension (Manifest V3) - vanilla JS/HTML/CSS, no build step. Supports **Chrome** and **Firefox**. 5 5 6 6 ## Architecture 7 7 - `popup/popup.js` - Main UI, chat, and summary generation 8 8 - `scripts/content.js` - Extracts text from the current webpage 9 9 - `scripts/background.js` - API communication with Ollama/OpenAI-compatible endpoints 10 10 - `options/options.js` - Settings page logic 11 - - `rules.json` - **NOT lint rules**; Chrome declarativeNetRequest rule that modifies CORS headers for `localhost:11434` API calls 11 + - `rules.json` - **NOT lint rules**; Browser declarativeNetRequest rule that modifies CORS headers for `localhost:11434` API calls 12 + 13 + ## Browser-Specific Manifests 14 + This extension has separate manifests for Chrome and Firefox: 15 + - `manifest.json` - Active manifest (run `./build.sh chrome` or `./build.sh firefox` to switch) 16 + - `manifest-chrome.json` - Chrome manifest (uses `service_worker`) 17 + - `manifest-firefox.json` - Firefox manifest (uses background scripts) 12 18 13 - ## Settings Storage 14 - - User settings: `chrome.storage.sync` 15 - - Session cache (summaries, chat history): `chrome.storage.session` 19 + ## Other Browser Differences 20 + Read BROWSER_SUPPORT.md for info.
+49 -69
README.md
··· 1 1 # WebAI Summarizer 2 2 3 - A minimalist Chrome extension that lets you ask questions and summarize any webpage using AI (Ollama or any OpenAI-compatible API). 3 + A minimalist browser extension for Chrome and Firefox that lets you ask questions and summarize any webpage using AI (using Ollama or any OpenAI-compatible API). Works best with the GPT-OSS-20b model. 4 + 5 + In **Beta**. Not yet in the Chrome Web Store or Firefox Addons. 4 6 5 7 ## Features 6 8 7 - - 🤖 **AI-Powered Chat** - Ask questions about the current webpage 8 - - 📄 **One-Click Summarize** - Instantly summarize page content 9 + - 📄 **One-Click Summaries** - Summarize page content efficently 10 + - 🤖 **Follow Up Questions** - Ask questions about the current webpage and summary 9 11 - 🔌 **OpenAI-Compatible** - Works with Ollama, OpenAI, Groq, LM Studio, and more 10 12 - ⚙️ **Configurable** - Choose your own model and API endpoint 11 - - 🌙 **Dark Theme** - Easy on the eyes 12 - - 🔒 **Private** - All processing happens locally with Ollama (optional) 13 + - 🔒 **Private** - All processing happens where you want it, including the option of running it locally with Ollama. Data never gets sent to servers. 14 + - ⌨️ **Quick access** - Keyboard shortcut of `Ctrl/Cmd+Shift+U`, use the right click menu, or click the extension icon. 13 15 14 - ## Installation 16 + ## Installation (in dev mode) 15 17 16 - ### 1. Load as Unpacked Extension 18 + ### Chrome 17 19 18 20 1. Open Chrome and navigate to `chrome://extensions/` 19 21 2. Enable **Developer mode** (toggle in top right) 20 22 3. Click **Load unpacked** 21 23 4. Select the `webai-summarizer` folder 22 24 5. The extension icon should appear in your toolbar 25 + 6. Optionally set up the keyboard shortcut at `chrome://extensions/shortcuts` 23 26 24 - ### 2. Install and Configure Ollama (Recommended) 27 + ### Firefox 25 28 26 - ```bash 27 - # Install Ollama (macOS) 28 - brew install ollama 29 + 1. Open Firefox and navigate to `about:debugging#/runtime/this-firefox` 30 + 2. Click **Load Temporary Add-on** 31 + 3. Select the `manifest.json` file in the `webai-summarizer` folder 32 + 4. The extension icon should appear in your toolbar 29 33 30 - # Pull a model 31 - ollama pull gemma3:1b 34 + **Note:** Firefox requires you to manually enable the keyboard shortcut: 35 + 1. Type `about:addons` in the address bar 36 + 2. Click the gear icon (⚙️) → **Manage Extension Shortcuts** 32 37 33 - # Start Ollama server (keep this running) 34 - ollama serve 35 - ``` 38 + ## TODO 36 39 37 - ### 3. Configure Settings 40 + - [ ] Better branding / icon / logo 41 + - [ ] Publish to Chrome Web Store 42 + - [ ] Publish to Firefox Add-ons 38 43 39 - 1. Click the extension icon 40 - 2. Click the **⚙️ Settings** gear 41 - 3. Configure the following: 44 + ### Build for Specific Browser 42 45 43 - #### For Ollama Native Mode (Recommended): 44 - ``` 45 - API Mode: Ollama Native 46 - API Base URL: http://localhost:11434 47 - Model: gemma3:1b (or your model name) 48 - API Key: (leave empty) 49 - ``` 46 + If needed, you can build for a specific browser: 50 47 51 - #### For OpenAI-Compatible Mode: 52 - ``` 53 - API Mode: OpenAI-Compatible 54 - API Base URL: http://localhost:11434/v1 (note the /v1) 55 - Model: llama3.2 56 - API Key: (leave empty for local Ollama) 57 - ``` 48 + ```bash 49 + # For Chrome 50 + ./build.sh chrome 58 51 59 - 4. Click **Test Connection** to verify 52 + # For Firefox 53 + ./build.sh firefox 54 + ``` 60 55 61 56 ## Usage 62 57 63 58 1. **Navigate to any webpage** 64 - 2. **Click the extension icon** in your toolbar 59 + 2. **Click the extension icon** in your toolbar, **or press `Ctrl/Cmd+Shift+U`** 65 60 3. **Click "Summarize Page"** for an instant summary, **or** 66 61 4. **Type a question** about the page content and press Enter 67 62 63 + 68 64 ## API Mode Explained 69 65 70 66 ### Ollama Native Mode 71 67 - Uses Ollama's native `/api/generate` endpoint 72 - - **No CORS issues** - works out of the box 68 + - Works out of the box if Ollama is installed 73 69 - Recommended for local Ollama installations 74 70 - Base URL should NOT include `/v1` 75 71 ··· 79 75 - Can work with Ollama if you set the `OPENAI_API_BASE` environment variable 80 76 - Base URL MUST include `/v1` for Ollama compatibility mode 81 77 82 - ## Supported APIs 83 - 84 - | Service | API Mode | Base URL | API Key | 85 - |---------|----------|----------|---------| 86 - | **Ollama** (local) | Native | `http://localhost:11434` | No | 87 - | **Ollama** (OpenAI format) | OpenAI-Compatible | `http://localhost:11434/v1` | No | 88 - | **OpenAI** | OpenAI-Compatible | `https://api.openai.com/v1` | Yes | 89 - | **Groq** | OpenAI-Compatible | `https://api.groq.com/openai/v1` | Yes | 90 - | **LM Studio** | OpenAI-Compatible | `http://localhost:1234/v1` | No | 91 - 92 78 ## Troubleshooting 93 79 94 80 ### "Cannot connect to localhost:11434" ··· 103 89 2. For Ollama Native: use `http://localhost:11434` (no /v1) 104 90 3. For OpenAI mode: use `http://localhost:11434/v1` (with /v1) 105 91 106 - ### "Model not found" 107 - ```bash 108 - # Pull the model first 109 - ollama pull llama3.2 110 - 111 - # Verify it's available 112 - ollama list 113 - ``` 114 - 115 - ### Extension not appearing 116 - - Make sure Developer mode is enabled 117 - - Try refreshing the extensions page 118 - 119 92 ## File Structure 120 93 121 94 ``` 122 95 webai-summarizer/ 123 - ├── manifest.json # Extension configuration 96 + ├── manifest.json # Extension configuration (active) 97 + ├── manifest-chrome.json # Chrome-specific manifest 98 + ├── manifest-firefox.json # Firefox-specific manifest 99 + ├── build.sh # Build script for browser switching 100 + ├── BROWSER_SUPPORT.md # Browser compatibility documentation 124 101 ├── popup/ 125 102 │ ├── popup.html # Chat interface 126 103 │ ├── popup.css # Styling 127 - │ └── popup.js # Popup logic 104 + │ ├── popup.js # Popup logic 105 + │ └── marked.min.js # Markdown parser 128 106 ├── scripts/ 129 107 │ ├── content.js # Webpage text extraction 130 108 │ └── background.js # API communication ··· 139 117 └── icon128.png 140 118 ``` 141 119 142 - ## Future Improvements 120 + ## Browser Compatibility 121 + 122 + | Feature | Chrome | Firefox | 123 + |---------|--------|---------| 124 + | Toolbar popup | ✅ | N/A (uses popup window) | 125 + | Popup window | N/A | ✅ | 126 + | Keyboard shortcut | ✅ | ✅ | 127 + | Context menu | ✅ | ✅ | 128 + | CORS proxy | ✅ (declarativeNetRequest) | ✅ | 143 129 144 - - [ ] Streaming responses 145 - - [ ] Conversation history persistence 146 - - [ ] Keyboard shortcuts 147 - - [ ] Context menu integration 148 - - [ ] PDF support 149 - - [ ] Chrome Web Store publishing 150 130 151 131 ## License 152 132