Closed konstantin-lukas closed 1 year ago
I am not using "visibility: hidden" but instead the hidden attribute (https://www.w3schools.com/tags/att_hidden.asp).
Like you noticed those lines that are left behind are inside 'ytd-item-section-renderer's style. So there is a need to remove the whole element together with videos inside that element. Currently the tag is used on the subscription page in list mode, and on search page. But with a difference that
on subscription page 'ytd-item-section-renderer' tag is used as holder for single video
but on search page 'ytd-item-section-renderer' tag can have multiple videos or even other video containers inside.
So I have decided to not delete/hide 'ytd-item-section-renderer' at all in case YouTube decides to further modify subscriptions page visuals or html structure to be like search page or vice versa.
I guess if there are a lot of shorts hidden then lines can get pretty thick. I can add some logic dedicated to subscription page which will also remove those lines by hiding 'ytd-item-section-renderer' (I would just hide whole tag when it contains a short video). But then when html structure changes in the future, then multiple other videos could get hidden by mistake. So I will add the feature as a new toggle in plugin's menu so could be turned off when something changes.
If you take a look at the below image you'll notice that one of the light gray lines between the videos is substantially thicker than the other ones. That's because there's three consecutive shorts there and each section has one of the 1 pixel high lines. Maybe consider giving the respective "ytd-item-section-renderer" element the css attribute "display: none;" instead of "visibility:hidden;"
I would generally consider replacing visibility with display across all scenarios. Here's a demo if you don't know what the difference is: https://www.w3schools.com/css/tryit.asp?filename=trycss_display
Support for display:none is only one percent less across the bord: https://caniuse.com/?search=display%3Anone https://caniuse.com/?search=visibility
Maybe consider using hidden only as a fallback?
I only looked at the source code briefly and maybe I misunderstood something but giving the outermost wrapper which is "ytd-item-section-renderer" "display:none;" certainly works for me.