···11# AGENTS.md
2233## Project Type
44-Chrome Extension (Manifest V3) - vanilla JS/HTML/CSS, no build step.
44+Browser Extension (Manifest V3) - vanilla JS/HTML/CSS, no build step. Supports **Chrome** and **Firefox**.
5566## Architecture
77- `popup/popup.js` - Main UI, chat, and summary generation
88- `scripts/content.js` - Extracts text from the current webpage
99- `scripts/background.js` - API communication with Ollama/OpenAI-compatible endpoints
1010- `options/options.js` - Settings page logic
1111-- `rules.json` - **NOT lint rules**; Chrome declarativeNetRequest rule that modifies CORS headers for `localhost:11434` API calls
1111+- `rules.json` - **NOT lint rules**; Browser declarativeNetRequest rule that modifies CORS headers for `localhost:11434` API calls
1212+1313+## Browser-Specific Manifests
1414+This extension has separate manifests for Chrome and Firefox:
1515+- `manifest.json` - Active manifest (run `./build.sh chrome` or `./build.sh firefox` to switch)
1616+- `manifest-chrome.json` - Chrome manifest (uses `service_worker`)
1717+- `manifest-firefox.json` - Firefox manifest (uses background scripts)
12181313-## Settings Storage
1414-- User settings: `chrome.storage.sync`
1515-- Session cache (summaries, chat history): `chrome.storage.session`
1919+## Other Browser Differences
2020+Read BROWSER_SUPPORT.md for info.
+49-69
README.md
···11# WebAI Summarizer
2233-A minimalist Chrome extension that lets you ask questions and summarize any webpage using AI (Ollama or any OpenAI-compatible API).
33+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.
44+55+In **Beta**. Not yet in the Chrome Web Store or Firefox Addons.
4657## Features
6877-- 🤖 **AI-Powered Chat** - Ask questions about the current webpage
88-- 📄 **One-Click Summarize** - Instantly summarize page content
99+- 📄 **One-Click Summaries** - Summarize page content efficently
1010+- 🤖 **Follow Up Questions** - Ask questions about the current webpage and summary
911- 🔌 **OpenAI-Compatible** - Works with Ollama, OpenAI, Groq, LM Studio, and more
1012- ⚙️ **Configurable** - Choose your own model and API endpoint
1111-- 🌙 **Dark Theme** - Easy on the eyes
1212-- 🔒 **Private** - All processing happens locally with Ollama (optional)
1313+- 🔒 **Private** - All processing happens where you want it, including the option of running it locally with Ollama. Data never gets sent to servers.
1414+- ⌨️ **Quick access** - Keyboard shortcut of `Ctrl/Cmd+Shift+U`, use the right click menu, or click the extension icon.
13151414-## Installation
1616+## Installation (in dev mode)
15171616-### 1. Load as Unpacked Extension
1818+### Chrome
171918201. Open Chrome and navigate to `chrome://extensions/`
19212. Enable **Developer mode** (toggle in top right)
20223. Click **Load unpacked**
21234. Select the `webai-summarizer` folder
22245. The extension icon should appear in your toolbar
2525+6. Optionally set up the keyboard shortcut at `chrome://extensions/shortcuts`
23262424-### 2. Install and Configure Ollama (Recommended)
2727+### Firefox
25282626-```bash
2727-# Install Ollama (macOS)
2828-brew install ollama
2929+1. Open Firefox and navigate to `about:debugging#/runtime/this-firefox`
3030+2. Click **Load Temporary Add-on**
3131+3. Select the `manifest.json` file in the `webai-summarizer` folder
3232+4. The extension icon should appear in your toolbar
29333030-# Pull a model
3131-ollama pull gemma3:1b
3434+**Note:** Firefox requires you to manually enable the keyboard shortcut:
3535+1. Type `about:addons` in the address bar
3636+2. Click the gear icon (⚙️) → **Manage Extension Shortcuts**
32373333-# Start Ollama server (keep this running)
3434-ollama serve
3535-```
3838+## TODO
36393737-### 3. Configure Settings
4040+- [ ] Better branding / icon / logo
4141+- [ ] Publish to Chrome Web Store
4242+- [ ] Publish to Firefox Add-ons
38433939-1. Click the extension icon
4040-2. Click the **⚙️ Settings** gear
4141-3. Configure the following:
4444+### Build for Specific Browser
42454343-#### For Ollama Native Mode (Recommended):
4444-```
4545-API Mode: Ollama Native
4646-API Base URL: http://localhost:11434
4747-Model: gemma3:1b (or your model name)
4848-API Key: (leave empty)
4949-```
4646+If needed, you can build for a specific browser:
50475151-#### For OpenAI-Compatible Mode:
5252-```
5353-API Mode: OpenAI-Compatible
5454-API Base URL: http://localhost:11434/v1 (note the /v1)
5555-Model: llama3.2
5656-API Key: (leave empty for local Ollama)
5757-```
4848+```bash
4949+# For Chrome
5050+./build.sh chrome
58515959-4. Click **Test Connection** to verify
5252+# For Firefox
5353+./build.sh firefox
5454+```
60556156## Usage
625763581. **Navigate to any webpage**
6464-2. **Click the extension icon** in your toolbar
5959+2. **Click the extension icon** in your toolbar, **or press `Ctrl/Cmd+Shift+U`**
65603. **Click "Summarize Page"** for an instant summary, **or**
66614. **Type a question** about the page content and press Enter
67626363+6864## API Mode Explained
69657066### Ollama Native Mode
7167- Uses Ollama's native `/api/generate` endpoint
7272-- **No CORS issues** - works out of the box
6868+- Works out of the box if Ollama is installed
7369- Recommended for local Ollama installations
7470- Base URL should NOT include `/v1`
7571···7975- Can work with Ollama if you set the `OPENAI_API_BASE` environment variable
8076- Base URL MUST include `/v1` for Ollama compatibility mode
81778282-## Supported APIs
8383-8484-| Service | API Mode | Base URL | API Key |
8585-|---------|----------|----------|---------|
8686-| **Ollama** (local) | Native | `http://localhost:11434` | No |
8787-| **Ollama** (OpenAI format) | OpenAI-Compatible | `http://localhost:11434/v1` | No |
8888-| **OpenAI** | OpenAI-Compatible | `https://api.openai.com/v1` | Yes |
8989-| **Groq** | OpenAI-Compatible | `https://api.groq.com/openai/v1` | Yes |
9090-| **LM Studio** | OpenAI-Compatible | `http://localhost:1234/v1` | No |
9191-9278## Troubleshooting
93799480### "Cannot connect to localhost:11434"
···103892. For Ollama Native: use `http://localhost:11434` (no /v1)
104903. For OpenAI mode: use `http://localhost:11434/v1` (with /v1)
10591106106-### "Model not found"
107107-```bash
108108-# Pull the model first
109109-ollama pull llama3.2
110110-111111-# Verify it's available
112112-ollama list
113113-```
114114-115115-### Extension not appearing
116116-- Make sure Developer mode is enabled
117117-- Try refreshing the extensions page
118118-11992## File Structure
1209312194```
12295webai-summarizer/
123123-├── manifest.json # Extension configuration
9696+├── manifest.json # Extension configuration (active)
9797+├── manifest-chrome.json # Chrome-specific manifest
9898+├── manifest-firefox.json # Firefox-specific manifest
9999+├── build.sh # Build script for browser switching
100100+├── BROWSER_SUPPORT.md # Browser compatibility documentation
124101├── popup/
125102│ ├── popup.html # Chat interface
126103│ ├── popup.css # Styling
127127-│ └── popup.js # Popup logic
104104+│ ├── popup.js # Popup logic
105105+│ └── marked.min.js # Markdown parser
128106├── scripts/
129107│ ├── content.js # Webpage text extraction
130108│ └── background.js # API communication
···139117 └── icon128.png
140118```
141119142142-## Future Improvements
120120+## Browser Compatibility
121121+122122+| Feature | Chrome | Firefox |
123123+|---------|--------|---------|
124124+| Toolbar popup | ✅ | N/A (uses popup window) |
125125+| Popup window | N/A | ✅ |
126126+| Keyboard shortcut | ✅ | ✅ |
127127+| Context menu | ✅ | ✅ |
128128+| CORS proxy | ✅ (declarativeNetRequest) | ✅ |
143129144144-- [ ] Streaming responses
145145-- [ ] Conversation history persistence
146146-- [ ] Keyboard shortcuts
147147-- [ ] Context menu integration
148148-- [ ] PDF support
149149-- [ ] Chrome Web Store publishing
150130151131## License
152132