How abba23/spotify-adblock works
spotify-adblock is a Linux preload library that intercepts Spotify’s CEF URL-request function, extracts each request URL, blocks matches against a configured denylist, and forwards other requests to CEF. Configuration is loaded from the user or system config directory; decisions are logged. The runtime path is clear from the excerpts, though no independent Spotify or CEF implementation is present in the repository.
Main entry points: lib.rs CEF request hook · config.rs Config discovery and parsing · hook.rs Symbol resolution · cef.rs CEF request ABI
Components 9
Request interception
- CEF request hook
src/lib.rs - CEF request ABI
src/cef.rs - Denylist filtering
src/lib.rs
Policy and configuration
- Config discovery and parsing
src/config.rs
Runtime support
- Symbol resolution
src/hook.rs - Decision logging
src/log.rs
Other components
- Spotify process
- Original CEF handler
- Config file
Connections 9
- Spotify process → CEF request hook: calls hooked API
README.md - CEF request hook → CEF request ABI: reads request URL
src/lib.rs - CEF request hook → Denylist filtering: checks URL
src/lib.rs - Denylist filtering → Config discovery and parsing: uses denylist
src/lib.rs - Config discovery and parsing → Config file: finds and reads
src/config.rs - CEF request hook → Original CEF handler: forwards allowed request
src/lib.rs - CEF request hook → Symbol resolution: declares wrapper
src/lib.rs - Symbol resolution → Original CEF handler: resolves next symbol
src/hook.rs - CEF request hook → Decision logging: logs decisions
src/lib.rs