A modern Chrome extension that uses local AI (Ollama) to automatically summarize webpage content with a beautiful, theme-aware side panel interface.
- Spacious Side Panel: Large, comfortable reading area that opens directly when you click the extension icon
- Theme-Aware Design: Automatically adapts to your Chrome theme (light/dark mode)
- Flat Design: Clean, modern interface with minimal shadows and consistent styling
- Progress Tracking: Beautiful animated progress bar showing AI processing stages
- Multiple Model Support: Choose from any Ollama model with automatic model discovery
- Smart Content Extraction: Intelligently extracts main content, filtering out navigation, ads, and clutter
- Configurable Word Limits: Choose from 250, 500, 750, or 1000 word summaries
- Rich HTML Formatting: Renders summaries with proper tables, headers, lists, and styling
- Persistent Settings: Model selection and word limits are saved automatically
- One-Click Model Refresh: Automatically discovers new Ollama models
- Real-Time Status: Shows current model and word limit in the interface
- Local Processing: All AI processing happens locally via Ollama
- HTML Sanitization: Prevents XSS attacks while maintaining rich formatting
- No Data Collection: Your content never leaves your computer
-
Ollama: Install Ollama on your system
# Install Ollama (visit https://ollama.ai for installation) # Pull a recommended model (or any model you prefer) ollama pull llama3.1 # or ollama pull qwen2.5 # or ollama pull mistral # Start Ollama service (runs on localhost:11434) ollama serve
-
Chrome Browser: Chrome or Chromium-based browser (version 114+ for side panel support)
activeTab- Access to current tab contentscripting- Execute content extraction scriptsstorage- Save user preferencessidePanel- Display the side panel interfacehost_permissions- Access web content (http:///, https:///)
gpt-oss:latest(default)llama3.1- Balanced performanceqwen2.5- Fast and efficientmistral- Good for technical content
By default, the extension expects Ollama to be running on:
- Endpoint:
http://localhost:11434 - API Routes Used:
/api/tags- List available models/api/chat- Generate summaries
# 1. Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# 2. Pull a model
ollama pull llama3.1
# 3. Start Ollama
ollama serve
# 4. Load extension in Chrome
# Navigate to chrome://extensions/ and load unpacked-
Clone the repository:
git clone https://github.com/LiteObject/ai-tldr-chrome-extension.git cd ai-tldr-chrome-extension -
Load the extension in Chrome:
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" (toggle in top-right corner)
- Click "Load unpacked"
- Select the extension folder
- Open Chrome and navigate to
-
Verify installation:
- The extension icon should appear in the Chrome toolbar
- Make sure Ollama is running with at least one model
- Chrome 114+: Uses modern side panel interface
- Older versions: Falls back to popup interface
- Both interfaces share the same settings via Chrome storage API
- Navigate to any webpage with content you want to summarize
- Click the extension icon - the side panel opens automatically
- Configure settings (optional):
- Click "Settings" to choose your AI model
- Select your preferred summary length (250-1000 words)
- Click "Summarize Current Page"
- Watch the progress bar as the AI processes your content
- Read your formatted summary in the comfortable side panel
- Model Management: Use "Refresh Models" to discover newly installed Ollama models
- Word Count: See exactly how many words are in your summary
- Theme Adaptation: The interface automatically matches your Chrome theme
- Settings Persistence: Your preferences are saved between sessions
- Manifest V3: Modern Chrome extension using latest APIs
- Side Panel API: Utilizes Chrome's newest side panel feature for better UX
- Theme Integration: Automatically detects and adapts to Chrome themes
- Progressive Enhancement: Works with any Ollama-compatible model
- Smart Extraction: Identifies main content areas using semantic selectors
- Noise Filtering: Removes navigation, ads, comments, and other clutter
- Content Optimization: Limits content length for optimal AI processing
- AI Summarization: Processes through local Ollama with customizable prompts
- Rich Rendering: Sanitizes and displays HTML with full formatting
- Headers (
h1,h2,h3,h4,h5,h6) - Text formatting (
strong,b,em,i,u) - Lists (
ul,ol,li) - Tables (
table,thead,tbody,tr,th,td) - Code blocks (
code,pre) - Blockquotes (
blockquote) - Paragraphs and line breaks
- Comprehensive HTML Sanitization: Prevents XSS attacks
- Safe Tag Whitelist: Only allows safe HTML elements and attributes
- Local Processing: No external API calls or data transmission
- Content Security Policy: Strict CSP compliance
- HTML sanitization removes all script tags and event handlers
- Only allows safe HTML tags (no iframe, embed, object, etc.)
- Filters all attributes except 'class'
- No external resource loading
ai-tldr-chrome-extension/
├── manifest.json # Extension manifest (V3)
├── sidepanel.html # Main side panel interface
├── sidepanel.js # Side panel functionality and AI integration
├── popup.html # Fallback popup interface
├── popup.js # Popup functionality
├── background.js # Service worker for extension coordination
├── icon.png # Extension icon
└── README.md # This file
- May not work on pages with heavy JavaScript rendering (SPAs)
- Content extraction limited to 8000 characters by default
- Requires active Ollama service running locally
- Cannot process PDF or other non-HTML content directly
The extension automatically detects available models, but you can set a default in sidepanel.js:
let selectedModel = 'your-preferred-model'; // Change this lineModify the available word limits in the HTML:
<select id="wordLimitSelector" class="word-limit-selector">
<option value="250">Very Short (250 words)</option>
<option value="500" selected>Short (500 words)</option>
<!-- Add custom values here -->
</select>The extension automatically adapts to Chrome themes, but you can customize colors in sidepanel.html:
:root {
--color-primary-brand: #your-color;
--color-primary-brand-text: #your-text-color;
}Test the connection directly:
curl http://localhost:11434/api/tags- Side Panel: Right-click in the side panel and select "Inspect"
- Background: Go to
chrome://extensions/→ Details → Inspect views: background page - Console Logs: Check for detailed theme detection and processing logs
- Edit the source files
- Go to
chrome://extensions/ - Click the refresh button on your extension
- Test the changes
Side panel doesn't open
- Ensure you're using Chrome 114+
- Reload the extension completely
- Check background script errors in extension details
"No models found"
- Verify Ollama is running:
ollama serve - Check available models:
ollama list - Use "Refresh Models" button in settings
Theme colors not applying
- Check browser console for theme detection logs
- Verify Chrome theme settings
- Dark mode detection should work automatically
Content extraction fails
- Try on different types of webpages
- Check if site has content restrictions
- View console logs for extraction details
AI processing errors
- Ensure Ollama model is fully downloaded
- Check Ollama service status
- Verify model compatibility with your system
- Choose appropriate word limits: Longer summaries take more processing time
- Use efficient models: Smaller models like
qwen2.5:7bare faster than larger ones - Close unused side panels: Multiple panels can consume resources
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Update documentation if needed
- Submit a pull request
- Follow existing code style and patterns
- Test with multiple Ollama models
- Ensure theme compatibility
- Verify side panel functionality
- Update README for new features
This project is open source. Please check the repository for license details.
- Ollama for providing excellent local AI capabilities
- Chrome Extensions API for the powerful platform
- Material Design principles for UI inspiration
- The open source community for tools and inspiration