

A Chrome extension that uses the Grok API to generate concise summaries of web pages with chat. This extension demonstrates integration with the Grok API through a secure local backend.
- 🚀 One-click page summarization
- 🔒 Secure API key handling via local backend
- 💨 Fast and responsive interface
- 🎨 Clean, modern dark theme UI
- Node.js (v14 or higher)
- npm
- Chrome browser
- Navigate to the server directory:
cd server
- Install dependencies:
npm install
- Create a
.env
file in the server directory with your Grok API key:
XAI_API_KEY=your_api_key_here
- Start the local server:
node server.js
- Open Chrome and navigate to
chrome://extensions/
- Enable "Developer mode" in the top right
- Click "Load unpacked" and select the extension directory
- The extension icon should appear in your Chrome toolbar
- Navigate to any webpage you want to summarize
- Click the extension icon in your Chrome toolbar
- Click the "Summarize" button in the popup
- Wait for the summary to appear
- Ask follor up questions about the article
grok-chrome-extension/
├── manifest.json # Extension configuration
├── popup.html # Extension popup interface
├── popup.css # Styles for the popup
├── popup.js # Popup functionality
├── background.js # Background service worker
├── contentScript.js # Page content extraction
├── images/ # Extension icons
└── server/ # Local backend
├── server.js # Express server
├── package.json # Backend dependencies
└── .env # API key configuration
- Make changes to the extension files
- Go to
chrome://extensions/
- Click the reload button on the extension card
- Test your changes
The backend server uses:
- Express.js for the server
- axios for API requests
- CORS for cross-origin support
- dotenv for environment variables
- The extension uses a local backend to keep the Grok API key secure
- All API calls are made through the local server, never directly from the extension
- CORS is configured for localhost only
- The extension requests minimal permissions
Common issues and solutions:
-
Summary not working
- Ensure the local server is running
- Check the API key in .env
- Look for errors in the browser console
-
Server won't start
- Verify Node.js installation
- Check if port 3000 is available
- Ensure all dependencies are installed
-
Extension not loading
- Verify Developer mode is enabled
- Check for console errors
- Try reloading the extension
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - feel free to use and modify for your own projects.