A powerful Chrome extension that filters your Twitter/X timeline by topics using AI-generated keywords. Create custom filters to see only the content you care about.
Watch Twitter Tabs filter your timeline in real-time with AI-powered topic detection.
- AI-Powered Keyword Generation: Automatically generates 50+ relevant keywords per topic using Groq or OpenAI
- Custom Topic Filters: Create unlimited filters for any topic (sports, tech, news, etc.)
- Real-Time Filtering: Intercepts Twitter's API to filter tweets before they reach your screen
- Dark Mode Support: Seamlessly integrates with Twitter's dark/light themes
- Manual Keyword Management: View, add, edit, and delete keywords for fine-tuned control
- Smart Caching: Saves generated keywords locally for instant filtering
- Zero Performance Impact: Efficient filtering that doesn't slow down Twitter
Click here to download Twitter Tabs on the Chrome Web Store! I'll be updating it relatively frequently.
- Clone the repository
git clone https://github.com/reknahs/twitter-tabs.git
cd twitter-tabs-
Set up API keys (All free! ββ Groq highly recommended because of speed and high token counts)
-
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
twitter-tabsfolder
- Open Chrome and navigate to
- Click the extension icon in your Chrome toolbar
- Enter a filter name (e.g., "Tech News")
- Add a description (e.g., "AI, programming, startups")
- Click "Generate & Add Filter"
- Visit Twitter - keywords will be generated automatically
- Go to your Twitter/X home timeline
- Look for the filter dropdown at the top of your timeline
- Click to select a filter or "All Tweets" to see everything
- The page will refresh with your filtered content
- Open the extension popup
- Click "View" next to any filter
- See all generated keywords
- Add custom keywords manually
- Delete unwanted keywords
- Click "Save Changes"
- If the Twitter algorithm does not have a decent chunk of tweets related to the requested topic, you might notice an increased amount of unrelated tweets for that topic
- This is because if no tweets are found on each search, the extension automatically inserts at least one tweet so infinite scroll can continue
- Because of this, the extension works best if about 10% or more of the timeline tweets are related to the current filter!
twitter-tabs/
βββ icons/ # Extension icons (multiple sizes)
βββ inject.js # Intercepts Twitter API calls
βββ twitter-tabs-content.js # Main content script & keyword generator
βββ twitter-tabs-popup.html # Extension popup interface
βββ twitter-tabs-popup.js # Popup functionality
βββ twitter-tabs-styles.css # UI styling for dropdown
βββ manifest.json # Extension configuration
βββ LICENSE # Apache 2.0 License
βββ README.md # This file
- Intercepts Twitter's GraphQL API calls using XMLHttpRequest and Fetch overrides
- Filters tweet entries before they render on the page
- Matches tweets against active filter keywords
- Preserves scroll cursors for infinite scrolling
- Uses AI (Groq/OpenAI) to generate 50+ contextually relevant keywords
- Caches keywords locally for performance
- Falls back to local generation if no API key is available
- Automatically generates keywords on first page load
- Dropdown Menu: Injected at the top of Twitter's timeline
- Popup: Manages filters, API keys, and keywords
- Modal: Keyword editor for fine-tuned control
| Provider | Speed | Cost | Recommended |
|---|---|---|---|
| Groq | β‘ Very Fast | π Free | β Yes |
| OpenAI | β‘ Fast | π° Paid | Alternative |
- Open the extension popup
- Select your preferred provider (Groq or OpenAI)
- Paste your API key
- Click "Save API Key"
Note: API keys are stored locally in Chrome storage and never sent anywhere except the selected AI provider.
- Google Chrome (or Chromium-based browser)
- Text editor (VS Code recommended)
- Basic knowledge of JavaScript and Chrome Extensions
- Manifest V3: Latest Chrome extension format
- Content Scripts: Injected into Twitter pages
- Chrome Storage API: Persists filters and keywords
- Groq/OpenAI APIs: AI-powered keyword generation
-
View Extension Logs
- Open
chrome://extensions/ - Click "background page" or "service worker"
- Check console for errors
- Open
-
Debug Content Script
- Open Twitter/X
- Press F12 to open DevTools
- Check Console tab for errors
-
Inspect Storage
- DevTools β Application β Storage β Chrome Extension Storage
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Add more AI providers (Anthropic Claude, Gemini, etc.)
- Improve keyword matching algorithm
- Add keyword suggestion features
- Create export/import functionality for filters
- Add statistics/analytics dashboard
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Filter dropdown is disabled on individual tweet pages (by design)
- First-time keyword generation requires internet connection
- Some tweets in threads may be filtered if any tweet matches keywords
- Because the Twitter algorithm requires tweets for infinite scroll, if no relevant tweets are found, one unrelated tweet will be inserted
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Twitter/X for their platform
- Groq for free, fast AI inference
- OpenAI for GPT models
- Chrome Extensions documentation
- AI assistance (Claude/ChatGPT) was partially used in the development of this extension
This extension is not affiliated with, endorsed by, or sponsored by Twitter/X Corp. Use at your own discretion. The extension modifies your local view of Twitter content but does not interact with Twitter's servers beyond normal usage.
Made with β€οΈ for better Twitter browsing
β Star this repo if you find it useful!