How hoangtrung1801/filter-for-kids-extension works
Main Components
a. Browser Extension Components:
• Popup Interface (entry: src/popup.tsx)
• Content Scripts (src/contents/)
• Background Service Worker (src/background.ts)
b. Core Feature Modules:
• Image Processing System (models/)
• NSFW Detection Model
• Violence Detection Model
• Layers Model
• Text Processing System
• Acronym Handler
• Word Replacement System
• Sino Word Handler
c. Supporting Systems:
• Queue System (src/lib/background/queue/)
• DOM Watching System (src/lib/content/DomWatcher.ts)
• Filter System (src/lib/content/filters/)
┌─ User Interface Layer ─────┐
• Popup │
• Content UI Overlays │
• Processing Layer ─────────┤
• Content Scripts │
• Background Worker │
• Core Services Layer ──────┤
• ML Models │
• Text Processing │
• Queue Management │
• ┘
Key Relationships to Highlight
a. Data Flow:
• Interaction between DOM Watcher and content filters
• ML model processing pipeline
b. Component Integration:
• How the Queue system manages processing requests
• How filters interact with ML models
• Demonstrate popup interface connections to background services
Technical Details
• TensorFlow.js Model Integration
• React Components for UI
• Background Worker Architecture
• Content Script Injection Points
Implementation Notes
• Rectangles: Core components
• Hexagons: Processing units
• Rounded rectangles: UI elements
User interaction (Popup and overlays)
• Abbreviations used
Keep the abstraction level focused on the architectural components while showing the relationship between the extension's various systems. This will help other developers understand both the high-level structure and the specific implementation details of the extension.