How ajayyy/sponsorblock works
Main Components
a. Browser Extension Components:
• Frontend UI Layer (popup, options, and content scripts)
• Background Service Worker
• Local Storage/Configuration
• Component Registry
b. External Services:
• SponsorBlock Server (API)
• YouTube/Invidious Integration
• NewLeaf Service
User Interface Layer
• Popup Interface (/public/popup.html)
• Options Page (/public/options)
• Content Scripts (src/content.ts)
• Help Pages (/public/help)
Core Extension Layer
• Background Service (src/background.ts)
• Components System (/src/components)
• Render System (/src/render)
• Utils (/src/utils)
External Integration Layer
• API Communication
• Video Platform Integration
• Database Interaction
Use the following visual elements:
• Hexagons for external services
• Blue: UI components
• Green: Core extension functionality
• Yellow: External services
• Gray: Utilities and helpers
Component Relationships
Key interactions:
[User Interface] ↔ [Background Service]
• ↕
[Content Scripts] ↔ [YouTube/Invidious]
• ↕
[Background Service] ↔ [SponsorBlock API]
Important Details
• Configuration flow (config.json.example → local storage)
• Category system for different skip types
• Crowdsourcing submission flow
• Video segment processing pipeline
• Cross-browser compatibility layer