A lightweight, dual-action solution for a cleaner Spotify experience. This project blocks audio ads, tracking, and visual distractions on both the Spotify Web Player and the Spotify Windows Desktop Application.
- Audio Ad Blocking: Intercepts and blocks audio ad requests before they play.
- Visual Ad Removal: Automatically hides banner ads and "Upgrade to Premium" buttons/prompts.
- Dynamic Protection: Uses a
MutationObserverto ensure new ad elements are hidden as they appear.
- Host-Level Blocking: Redirects known Spotify ad and tracking domains to
0.0.0.0via the Windowshostsfile. - Comprehensive Domain List: Blocks over 40+ domains responsible for audio ads, banners, and analytics.
- Easy Deployment: A simple PowerShell script that backups your existing hosts file and flushes DNS for immediate effect.
- Open Chrome or any Chromium-based browser (Edge, Brave, etc.).
- Navigate to
chrome://extensions/. - Enable Developer mode (toggle in the top right).
- Click Load unpacked and select the
/extensionfolder from this repository. - Enjoy an ad-free web player!
Important
This script requires Administrator privileges to modify the Windows hosts file.
- Locate
spotify_blocker.ps1. - Right-click the file and select Run with PowerShell.
- If prompted for permissions, select Yes.
- Restart your Spotify desktop app to apply the changes.
/extension: The Chrome extension files (manifest.json,content.js, etc.).spotify_blocker.ps1: The PowerShell script for desktop ad blocking.
This project is for educational purposes only. Blocking ads may violate Spotify's Terms of Service. Use at your own risk.
Feel free to open issues or submit pull requests with updated ad domains or improved CSS selectors!