gijsdev / ublock-hide-yt-shorts

uBlock Origin filter list to hide YouTube Shorts
MIT License
1.15k stars 63 forks source link

Restore compability for YouTube in other languages #25

Open execvpe opened 4 months ago

execvpe commented 4 months ago

Hi,

to my understanding, there is no requirement for these specific regex checks that were added in recently.

www.youtube.com##ytd-reel-shelf-renderer (and m.youtube.com##ytm-reel-shelf-renderer) by itself should - as the name implies - only blocks the rendering of the reel shelf, nothing else should be affected.

In addition to that, comparing against the hard coded string Shorts remixing this video only works, if you use YouTube in an English environment.

For example, the filter did not affect German YouTube which has another text displayed due to localization.

20240218_213040

Feel free to correct me, if I'm wrong. :)

gijsdev commented 4 months ago

I don't really like adding filters which don't specifically mention Shorts in it. Maybe YouTube will use the same element for something else, which then breaks said thing of course. It should work by checking for the words "Shorts" and "Remix" instead of the entire sentence.

execvpe commented 4 months ago

I don't really like adding filters which don't specifically mention Shorts in it.

Understandable. I fixed the code, so that the regex will check for "Shorts" and "Remix" in that order. It should work for most languages now.

While researching I discovered, that there is a Shorts section beside the comments too, which was not affected by the changed regex alone, because its missing ytd-structured-description-content-renderer. That's the reason I removed that bit.