How jhpacker/slopguard works
SlopGuard is a local-only browser extension that scans eligible page images on user request (or a single right-clicked image), runs provenance and visual-detection tiers, and marks the result in the page. The main runtime path is page scan → background detection cascade → offscreen C2PA and model inference → page overlays. Metadata and byte checks run in the background; SynthID preprocessing supports its model input. The excerpts do not show the full cascade or toolbar/context-menu dispatch wiring, so those connections are limited to documented behavior and visible message calls.
Main entry points: background.js Detection coordinator · content.js Image scan and overlays · offscreen.html Offscreen detector host · offscreen.js SynthID watermark inference
Components 16
Page scanning
- Image scan and overlays
src/content.js - Overlay styles
src/overlay.css
Detection pipeline
- Detection coordinator
src/background.js - Image bytes
src/background.js - EXIF/IPTC/XMP checks
src/background.js - Byte marker checks
src/background.js
Local inference
- Offscreen detector host
src/offscreen.html - C2PA manifest checks
src/offscreen.js - SynthID watermark inference
src/offscreen.js - SynthID preprocessing
src/synthid-preprocess.js - Visual classifier inference
src/offscreen.js - Local ONNX models
Extension settings
- Debug options
src/options.js - Extension settings storage
Other components
- Extension user
- Web page
Connections 20
- Extension user → Image scan and overlays: requests scan
- Web page → Image scan and overlays: provides images
- Image scan and overlays → Detection coordinator: requests detection
- Detection coordinator → Image bytes: fetches image
- Detection coordinator → EXIF/IPTC/XMP checks: parses metadata
- Detection coordinator → Byte marker checks: scans bytes
- Detection coordinator → Offscreen detector host: dispatches checks
- Offscreen detector host → C2PA manifest checks: runs manifest check
- Offscreen detector host → SynthID watermark inference: runs watermark check
- Offscreen detector host → Visual classifier inference: runs classifier
- SynthID watermark inference → SynthID preprocessing: builds model input
- SynthID watermark inference → Local ONNX models: uses SynthID model
- Visual classifier inference → Local ONNX models: uses OpenFake model
- Detection coordinator → Image scan and overlays: returns verdict
- Image scan and overlays → Web page: marks images
- Overlay styles → Web page: styles overlays
- Debug options → Extension settings storage: reads and writes
- Detection coordinator → Extension settings storage: reads debug settings
- Image scan and overlays → Extension settings storage: reads debug setting
- Offscreen detector host → Extension settings storage: reads debug setting