A powerful browser extension that extracts text from any webpage, generates AI-powered summaries, and allows intelligent Q&A using embeddings and similarity search.
- π Smart Text Extraction: Automatically extracts main content from web pages using intelligent selectors
- π€ AI-Powered Summaries: Generate concise, informative summaries using OpenAI's GPT models
- π¬ Intelligent Q&A: Ask questions about page content using embedding-based similarity search
- π SPA Support: Works with Single Page Applications using MutationObserver
- π¨ Modern UI: Clean, responsive interface built with React and Tailwind CSS
- π§ Cross-Browser: Works on Chrome, Edge, and Firefox
- β‘ Real-time Processing: Automatic content extraction and processing
- Embeddings API: Process and store page content with OpenAI embeddings
- Summary API: Generate page summaries using GPT models
- Q&A API: Answer questions using similarity search and context retrieval
- MongoDB Storage: Store page chunks with embeddings for efficient retrieval
- Content Script: Extracts text from web pages with SPA support
- Background Service Worker: Handles communication and data processing
- React Popup: Modern UI for summaries and Q&A interface
- Cross-browser Compatibility: Works on Chrome, Edge, and Firefox
AIExtension/
βββ backend/ # Node.js + Express backend
β βββ models/
β β βββ PageChunk.js # MongoDB schema for page chunks
β βββ routes/
β β βββ embeddings.js # Handle text processing and embeddings
β β βββ summary.js # Generate page summaries
β β βββ ask.js # Q&A functionality
β βββ utils/
β β βββ chunkText.js # Text chunking utilities
β β βββ cosineSimilarity.js # Similarity search functions
β βββ server.js # Main Express server
β βββ package.json # Backend dependencies
β βββ env.example # Environment variables template
βββ extension/ # Browser extension
β βββ popup/ # React popup application
β β βββ src/
β β β βββ components/
β β β β βββ SummaryView.jsx
β β β β βββ ChatView.jsx
β β β β βββ SettingsView.jsx
β β β βββ App.jsx
β β β βββ main.jsx
β β βββ package.json # Popup dependencies
β β βββ vite.config.js # Build configuration
β βββ manifest.json # Extension manifest
β βββ background.js # Service worker
β βββ contentScript.js # Content extraction script
βββ README.md # This file
- Node.js (v16 or higher)
- MongoDB (local or cloud)
- OpenAI API key
- Modern browser (Chrome, Edge, or Firefox)
# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create environment file
cp env.example .env
# Edit .env file with your configuration
# Add your OpenAI API key and MongoDB URIEnvironment Variables (.env):
OPENAI_API_KEY=your_openai_api_key_here
MONGO_URI=mongodb://localhost:27017/summarizer_extension
PORT=5000
NODE_ENV=development# Start the backend server
npm run dev
# The server will be running on http://localhost:5000# Navigate to extension popup directory
cd extension/popup
# Install dependencies
npm install
# Build the popup
npm run build
# The built files will be in extension/dist/- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
extensionfolder - The extension should now appear in your toolbar
- Open
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on"
- Select the
manifest.jsonfile from the extension folder
- Click the extension icon in your browser
- Go to the Settings tab
- Verify the backend URL (default: http://localhost:5000)
- Test the connection
- Enable auto-extract if desired
- Navigate to any webpage - The extension automatically extracts content
- Click the extension icon - Opens the popup with three tabs
- Summary Tab - View AI-generated summary of the page
- Q&A Tab - Ask questions about the page content
- Settings Tab - Configure backend URL and preferences
- Research: Quickly summarize long articles and ask specific questions
- Learning: Extract key points from educational content
- News: Get summaries of news articles and ask follow-up questions
- Documentation: Understand technical documentation faster
Backend API (http://localhost:5000)
Process page text and generate embeddings
{
"page_url": "https://example.com",
"text": "Page content...",
"title": "Page Title"
}Generate page summary
{
"page_url": "https://example.com"
}Answer questions about page content
{
"page_url": "https://example.com",
"question": "What is the main topic?"
}Health check endpoint
- Modify
extension/popup/src/index.cssfor custom styles - Update
extension/popup/tailwind.config.jsfor theme customization
- Adjust chunk sizes in
backend/utils/chunkText.js - Modify similarity search parameters in
backend/utils/cosineSimilarity.js - Update OpenAI model settings in route files
- Add new tabs in
extension/popup/src/App.jsx - Modify content extraction logic in
extension/contentScript.js - Update permissions in
extension/manifest.json
- Set up MongoDB (local or cloud)
- Deploy to your preferred platform (Heroku, Vercel, AWS, etc.)
- Update environment variables
- Update extension settings with new backend URL
- Build the popup:
cd extension/popup && npm run build - Create a ZIP file of the extension folder
- Submit to browser extension stores (Chrome Web Store, Firefox Add-ons)
Backend Connection Failed:
- Check if backend server is running
- Verify MongoDB connection
- Ensure OpenAI API key is valid
- Check CORS settings
Extension Not Working:
- Verify extension is loaded in browser
- Check browser console for errors
- Ensure backend URL is correct in settings
- Test with a simple webpage first
Content Not Extracting:
- Check if page has sufficient text content
- Verify content script permissions
- Try refreshing the page
- Check browser console for errors
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
MIT License - see LICENSE file for details
- OpenAI for GPT models and embeddings
- React and Tailwind CSS for the UI
- Chrome Extension Manifest v3
- MongoDB for data storage
Happy summarizing and questioning! π