How yahianshi/puretube works
PureTube is a Chromium extension that optimizes YouTube playback and presentation. A viewer watches YouTube while the content script applies SponsorBlock skips, silence acceleration, volume gain, and CSS-based debloating; saved-time metrics are persisted and shown in the popup. Users configure features in the popup, which stores preferences and sends live updates to the active tab. The README documents the combined audio graph and SPA lifecycle; sampled excerpts show settings, messaging, API fetching, and statistics. Some internal wiring is not excerpted, so unsupported links are omitted.
Main entry points: content.js Content engine · popup.js Popup controller · popup.html Popup controls · debloat.css CSS debloater
Components 15
Popup interface
- Popup controls
popup.html - Popup controller
popup.js - Popup styling
popup.css
Playback engine
- Content engine
content.js - Segment skip and undo
content.js - Silence skipper
content.js - Audio gain pipeline
content.js
YouTube presentation
- Highlights and toast
content.js - CSS debloater
debloat.css
Settings and analytics
- Sync settings
- Time-saved tracker
content.js - Local stats
Other components
- Viewer
- YouTube player
- SponsorBlock API
Connections 19
- Viewer → YouTube player: watches
README.md - Viewer → Popup controls: configures
README.md - Popup controls → Popup controller: controls
popup.js - Popup controller → Sync settings: writes settings
popup.js - Content engine → Sync settings: reads settings
content.js - Popup controller → Content engine: sends updates
popup.js - YouTube player → Content engine: provides playback
README.md - Content engine → SponsorBlock API: fetches segments
content.js - Content engine → Segment skip and undo: dispatches skips
README.md - Segment skip and undo → YouTube player: seeks video
README.md - Segment skip and undo → Highlights and toast: shows skip UI
content.js - Content engine → Silence skipper: runs detection
content.js - Silence skipper → Audio gain pipeline: uses analysis
README.md - Audio gain pipeline → YouTube player: amplifies audio
README.md - Content engine → CSS debloater: sets root attributes
README.md - Content engine → Time-saved tracker: tracks playback
content.js - Time-saved tracker → Local stats: persists metrics
content.js - Popup controller → Local stats: loads metrics
popup.js - Popup controller → Content engine: requests stats
popup.js