Skip to content

[Suggestion] Avoid using social-links-list class, as it may be blocked by EasyList #4732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks done
nshcr opened this issue May 4, 2025 · 3 comments
Open
4 tasks done
Labels
theme Related to the theme

Comments

@nshcr
Copy link

nshcr commented May 4, 2025

Describe the bug

The EasyList social filter rules include .social-links-list selector, which causes certain elements on VitePress pages to not display properly.

Here’s the affected component code:

<VPSocialLinks class="social-links-list" :links="theme.socialLinks" />

Here’s the source of the EasyList rule (Be cautious when accessing this file — it’s quite large and may crash your browser):
https://github.com/easylist/easylist/blob/053fcd167ec66bd798cb9c3dde99c2906b1ffde8/fanboy-addon/fanboy_social_general_hide.txt#L8004

Image

Reproduction

When ad blockers like uBO or Adblock Plus have the social rules enabled, the affected element disappears.

Image Image

Disabling the relevant rule restores them to normal.

Image

Expected behavior

I'm aware this is a Fanboy rule and not enabled by default, but ad blockers often make it easy for users to enable it. Renaming the class to something not on the blocklist is a simpler and more practical workaround.

Changing it to social-links-items should work, though in the long run, it might be better to avoid using names like social-link altogether.

System Info

Not necessary.

Additional context

No response

Validations

@nshcr nshcr added the bug: pending triage Maybe a bug, waiting for confirmation label May 4, 2025
@brc-dd brc-dd removed the bug: pending triage Maybe a bug, waiting for confirmation label May 4, 2025
@brc-dd
Copy link
Member

brc-dd commented May 4, 2025

It's bit hard to workaround that stuff. We can try changing, but that might also end up on some filter list. The only robust way is to obscure the class names (like use hashes) but it makes it almost impossible for others to override stuff reliably. Also, I think the people using that filter expect social links to be not shown, which is exactly what happens, so not sure if we should even change it.

@nshcr
Copy link
Author

nshcr commented May 4, 2025

Currently, VitePress has three responsive layouts for different browser widths:

  1. At the widest width, the social links are fully displayed — no filtering issues.
  2. At the narrowest width, the social links are placed in a dropdown menu — no filtering issues.
  3. At medium width, the social links are placed in a dropdown menu — but they get blocked by the filter.

I raised this issue because I noticed this inconsistent behavior, which led me to investigate and trace it back to the EasyList rules. I believe this is clearly a case of false positive blocking.

It's bit hard to workaround that stuff. We can try changing, but that might also end up on some filter list. The only robust way is to obscure the class names (like use hashes) but it makes it almost impossible for others to override stuff reliably. Also, I think the people using that filter expect social links to be not shown, which is exactly what happens, so not sure if we should even change it.

You’re right — there’s no need to get into a tug of war with ad blockers. However, I believe sites built with VitePress were never meant to be their target. My main reason for blocking social links is to block potential tracking behavior on certain sites, not to block community links or the social media accounts of users I’m interested in.

In fact, most tech sites’ social links aren’t blocked — Nuxt’s social links are even on the allowlist — but major VitePress sites like the Vite and VitePress official documentation are getting blocked. This can easily be mistaken for a bug on the site.

https://github.com/easylist/easylist/blob/2bf38873ee2f383203209c763e17e914e3a63736/fanboy-addon/fanboy_social_allowlist.txt#L44

@brc-dd
Copy link
Member

brc-dd commented May 4, 2025

At the widest width, the social links are fully displayed — no filtering issues.

They have social-links class:

Image


This is skipped quite by luck though, as only #social-links is present on the list not .social-links.

Also, this will be a breaking change as many people are using it to add custom styles - https://github.com/search?q=vitepress+/%5C.social-links/+NOT+is:fork+path:/(?:s?css%7Cstyl%7C%5Bjt%5Dsx?%7Cvue)$/&type=code

We can maybe change it along with the v2 theme rewrite.

@brc-dd brc-dd added the theme Related to the theme label May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme Related to the theme
Projects
None yet
Development

No branches or pull requests

2 participants