Skip to content

fix(adblock): hide empty leaderboard and upgrade menu item - #171

Open
Dafenxz0 wants to merge 1 commit into
rxri:mainfrom
Dafenxz0:fix/collapse-ad-ui
Open

fix(adblock): hide empty leaderboard and upgrade menu item#171
Dafenxz0 wants to merge 1 commit into
rxri:mainfrom
Dafenxz0:fix/collapse-ad-ui

Conversation

@Dafenxz0

@Dafenxz0 Dafenxz0 commented Jul 6, 2026

Copy link
Copy Markdown

On recent Spotify builds the leaderboard ad itself is hidden, but its outer wrapper still reserves space. That leaves a black strip above the player on playlist pages.

The upgrade row in the profile menu also no longer always points directly to spotify.com/premium; it can use an internal or tracked route, so the old href-based selector misses it.

This change:

  • collapses the wrapper that directly contains the hidden leaderboard;
  • watches newly added menu items and hides the one whose localized label matches upgrade.tooltip.title;
  • updates the generated adblock.js bundle.

Tested manually on Windows with Spotify 1.2.93.667 and Spicetify 2.44.0: the blank strip is gone on playlist pages and the upgrade entry no longer appears in the profile menu. The generated bundle also passes node --check.

@rxri

rxri commented Jul 6, 2026

Copy link
Copy Markdown
Owner

but the blank strip on the playlists page appear only when script didn't load fast enough when installed via marketplace. If you will use adblockify locally it will never appear.

@Dafenxz0

Dafenxz0 commented Jul 6, 2026

Copy link
Copy Markdown
Author

Ah, I didn’t know the Marketplace version could load late — that explains why I could reproduce the blank strip there but not with a local install. Thanks for clarifying. I still think collapsing the empty wrapper is a harmless fallback for that timing case, while the upgrade-menu fix is independent. If you’d prefer, I can split the changes or keep only the menu fix.

@rxri

rxri commented Jul 6, 2026

Copy link
Copy Markdown
Owner

I would prefer if the css would not use any selectors since they're "slow" though

@Dafenxz0

Dafenxz0 commented Jul 6, 2026

Copy link
Copy Markdown
Author

Yeah, fair — I assume you mean the new :has() selectors. I can remove those and handle the late leaderboard in the MutationObserver instead: when the leaderboard node is inserted, hide its immediate wrapper directly. That avoids a persistent relational CSS selector and only runs when nodes are added. I’ll update the PR accordingly.

Repository owner deleted a comment from 1dark9 Jul 18, 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