How avr1i/nsfw-blocker-extension works
NSFW Defender is a client-side Chromium extension for YouTube. The user enables monitoring in the popup; its messages toggle the content script, which periodically captures video frames, classifies them with the bundled model, and blurs or restores the video. The README also documents manifest-based page injection and TensorFlow.js. The sampled source shows the popup messaging and content-script loop; other wiring and library details are supported only by the README, so the graph does not infer additional calls.
Main entry points: contents.js NSFW classification · extension.html Popup controls · popup.js Toggle messaging · model.json Classification model
Components 12
User interface
- Popup controls
EXTENSION/extension.html - Toggle messaging
EXTENSION/popup.js
Video detection
- Content script
EXTENSION/contents.js - Frame capture
EXTENSION/contents.js - NSFW classification
EXTENSION/contents.js - Classification model
EXTENSION/Model/model.json - Model weights
EXTENSION/Model/group1-shard1of1 - Video blur
EXTENSION/contents.js
Extension runtime
- Page injection config
EXTENSION/manifest.json - TensorFlow.js runtime
EXTENSION/tf.js
Other components
- Extension user
- YouTube video page
Connections 12
- Extension user → Popup controls: opens
README.md - Popup controls → Toggle messaging: uses
README.md - Toggle messaging → Content script: sends toggles
EXTENSION/popup.js - Page injection config → Content script: injects on YouTube
README.md - YouTube video page → Content script: hosts
README.md - Content script → Frame capture: runs periodically
EXTENSION/contents.js - Frame capture → NSFW classification: classifies frame
EXTENSION/contents.js - NSFW classification → Classification model: loads and classifies with
EXTENSION/contents.js - Classification model → Model weights: uses weights
- NSFW classification → TensorFlow.js runtime: uses runtime
- NSFW classification → Video blur: sets blur state
EXTENSION/contents.js - Video blur → YouTube video page: blurs video
EXTENSION/contents.js