A Chrome extension that automatically detects and blocks images related to a configurable TV show using AI.
- Blur-first approach: Images are blurred immediately, then analyzed
- Hybrid AI analysis: Local heuristic pre-filter + OpenAI Vision API for accurate detection
- Configurable target: Choose which TV show to filter
- Site controls: Whitelist trusted sites, blacklist problematic ones
- Statistics tracking: See how many images have been blocked
- Privacy-focused: Images are analyzed but never stored
-
Clone or download this repository
-
Open Chrome and navigate to
chrome://extensions/ -
Enable "Developer mode" (toggle in top-right corner)
-
Click "Load unpacked"
-
Select the
extensionfolder from this project -
The extension icon should appear in your toolbar
The extension includes placeholder icons. To generate custom icons:
- Open
extension/assets/generate-icons.htmlin a browser - Right-click each canvas and save as the specified filename
- Replace the placeholder PNGs in
extension/assets/
- Click the extension icon in your toolbar
- Click "Settings" to open the options page
- Enter the TV show name you want to filter (e.g., "Breaking Bad")
- Optionally add context to improve detection accuracy
For accurate image classification:
- Get an API key from platform.openai.com
- Open extension Settings
- Paste your API key
- Click "Test" to verify it works
- Click "Save Settings"
Cost: Approximately $0.0005 per image analyzed (using GPT-4o with low detail)
- Whitelist: Sites where filtering is disabled
- Blacklist: Sites where all images are blocked immediately
Image Detected -> Apply Blur -> Analyze -> Reveal or Block
|
+--------------+--------------+
| |
Local Heuristic OpenAI Vision
(placeholder filter) (accurate analysis)
| |
If confident, Returns decision
skip cloud API (related/not related)
- Detection: MutationObserver watches for new images (>=100x100px)
- Blur: Images are immediately blurred to prevent viewing
- Analysis: Local heuristics check for obvious non-matches; uncertain cases go to OpenAI Vision
- Decision: Based on AI analysis, images are either revealed (safe) or fully blocked (match)
extension/
|-- manifest.json # Chrome extension configuration
|-- background/
| +-- service-worker.js # Analysis pipeline coordinator
|-- content/
| |-- content.js # Main content script
| |-- image-observer.js # Detects images on pages
| +-- image-blocker.js # Handles blur/block effects
|-- lib/
| |-- storage.js # Chrome storage utilities
| |-- local-classifier.js # Heuristic pre-filter
| +-- openai-client.js # OpenAI Vision API client
|-- popup/ # Extension popup UI
+-- options/ # Settings page
- No data collection: The extension doesn't collect or transmit any user data
- API requests: Images are sent to OpenAI's API for analysis (if configured)
- Local processing: Without an API key, only local heuristics are used
- No storage: Analyzed images are not stored; only statistics counters are kept
- API costs: Accurate classification requires OpenAI API usage
- Speed: API calls add latency; images remain blurred until analyzed
- Accuracy: Detection depends on AI model capabilities
- Service worker constraints: TensorFlow.js would require offscreen documents (future enhancement)
- Ensure the extension is enabled (check popup toggle)
- Verify a target show is configured
- Check if the site is whitelisted
- Ensure images meet minimum size (100x100px)
- Check if API key is configured and valid
- Without an API key, uncertain images remain blurred
- Check the browser console for errors
- Ensure all files are present in the extension folder
- Check Chrome's extension error page for details
- Try reloading the extension
- Make changes to the source files
- Go to
chrome://extensions/ - Click the refresh button on the extension card
- Test changes on web pages
- Offscreen document for TensorFlow.js/MobileNet local classification
- Support for multiple shows
- Image caching to reduce API calls
- Sync settings across devices
- Export/import settings
MIT License - See LICENSE file for details
Built with:
- OpenAI Vision API for image analysis
- Chrome Extensions Manifest V3