A minimal Chrome extension that automatically closes tabs containing NSFW images using Hugging Face AI detection.
- Real-time Detection: Scans all images on web pages instantly
- Tab Closure: Closes tabs immediately when NSFW content is detected
- Hugging Face AI: Uses professional NSFW detection models
- Minimal & Fast: Lightweight with optimized performance
- Production Ready: Error handling and efficient caching
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked" and select the extension folder
- Extension will start working immediately
- Get a Hugging Face API key from Hugging Face
- Open
background.js - Replace
'YOUR_HUGGINGFACE_API_KEY_HERE'with your API key - Alternatively, you can use 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 as the API key.
- Works without API key for testing
- Uses random detection (10% chance)
- Replace with real API key for production use
- Content Script: Scans all
<img>elements on web pages - Image Processing: Converts images to base64 and sends to API
- AI Detection: Hugging Face model classifies content
- Tab Closure: Background script closes tab if NSFW detected
- Bikini/Swimwear
- Lingerie/Underwear
- Nudity/Naked content
- Explicit/Pornographic material
- Sexual content
- Primary:
Falconsai/nsfw_image_detection - Alternative:
openai/clip-vit-base-patch32
- Images processed client-side before API call
- Results cached to avoid duplicate API requests
- No permanent data storage
- Respects 1MB image size limits
- Chrome Browser (Manifest V3)
- OpenAI API key (recommended)
- Internet connection for API calls
MIT License - See LICENSE file for details