Skip to content

feat(snippets): add Hide Playlist Ads snippet - #1204

Closed
h3j4 wants to merge 2 commits into
spicetify:mainfrom
h3j4:snippet/hide-playlist-ads
Closed

feat(snippets): add Hide Playlist Ads snippet#1204
h3j4 wants to merge 2 commits into
spicetify:mainfrom
h3j4:snippet/hide-playlist-ads

Conversation

@h3j4

@h3j4 h3j4 commented Jul 29, 2026

Copy link
Copy Markdown

Hides sponsored content in playlist and Now Playing headers: the video ad, the "Limited ads • Presented by X" row in both places, and the sponsor card section.

Every selector anchors on data-testid, href, or css-map class names rather than Spotify's hashed classes. Each target has two independent anchors so a single rename doesn't disable the rule.

Summary by CodeRabbit

  • New Features
    • Added a “Hide Playlist Ads” snippet to remove sponsored playlist video ads, ad labels/overlays, and sponsor-card sections from the page.
    • Included a preview asset for the new snippet.

@h3j4
h3j4 requested a review from a team as a code owner July 29, 2026 18:45
@h3j4
h3j4 requested review from Delusoire and removed request for a team July 29, 2026 18:45
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3730886d-d449-475b-8c89-f0995fb2877b

📥 Commits

Reviewing files that changed from the base of the PR and between 41dd48a and 172cff5.

📒 Files selected for processing (1)
  • resources/snippets.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • resources/snippets.json

Walkthrough

Adds a “Hide Playlist Ads” snippet to resources/snippets.json, using CSS selectors to hide sponsored video ads, playlist header labels and overlays, now-playing ad overlays, and sponsor cards.

Changes

Playlist ad hiding

Layer / File(s) Summary
Register playlist ad hiding snippet
resources/snippets.json
Adds the “Hide Playlist Ads” snippet with selectors, description, and preview asset path.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: delusoire

Poem

A bunny hid the ads away,
From playlist night to header day.
CSS whiskers, selectors bright,
Sponsor cards vanish out of sight.
Hop, hop—clean screens take flight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a new Hide Playlist Ads snippet under snippets.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@resources/snippets.json`:
- Line 557: Update the `.main-entityHeader-headerText` selector to target an
ad-specific discriminator rather than any `a[target="_blank"]`; use the
available ad-specific href, data-testid, or class, and retain a separate
fallback selector only when it is independently ad-specific. Ensure legitimate
owner or metadata links do not cause the entire header row to be hidden.
- Line 557: Update the sponsor-card selectors near
section[aria-label="Advertisement"] to include a locale-independent stable
anchor from the card DOM, such as its testid, class, or distinctive structure,
while preserving the existing hostname selectors. Add localized fixture coverage
confirming the new selector hides the sponsor card when the aria-label is not
English and no servedby./flashtalking link is present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d5c3a81f-5098-4b6d-bbb2-229f047f7f2e

📥 Commits

Reviewing files that changed from the base of the PR and between e3f65ed and 41dd48a.

⛔ Files ignored due to path filters (1)
  • resources/assets/snippets/hide-playlist-ads.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • resources/snippets.json

Comment thread resources/snippets.json Outdated
@h3j4

h3j4 commented Jul 29, 2026

Copy link
Copy Markdown
Author

Good catches, both addressed.

  1. Confirmed: a playlist description containing an external link matched the old selector. Re-anchored on the ad-server host (servedby. / flashtalking) so only sponsored rows match.

  2. Added section:has([data-encore-id="listRow"] a[target="_blank"][href^="http"]) as a locale-independent anchor. data-encore-id alone would be far too broad, but combined with an off-site link it's ad-specific: Spotify's own list rows link to internal paths. Verified against a localized card with an unrecognised ad host.

On localized fixtures: snippets in this repo are CSS strings in snippets.json with no test harness, so there's nowhere to add them. Happy to include the markup I tested against in the PR description if that's useful.

@rxri

rxri commented Jul 29, 2026

Copy link
Copy Markdown
Member

Marketplace snippets are not a place to do ad-hiding functionality

@rxri rxri closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants