youtube icon indicating copy to clipboard operation
youtube copied to clipboard

Limit the number of thumbnail rows in youtube home.

Open lalishansh opened this issue 6 months ago • 11 comments

PROBLEM: Youtube has lot's of new sections in home (they've been forever), and dang i don't like them at all, Ability to limit (or disable) them will work wonders (crude implementation will work for me) basically i don't want anything from Explore more topics Image

Maybe delete anything after (including this, may be also need to especially delete ytd-continuation-item-renderer element) Image

SOLUTION: Like Thumbnails Per Row and another option to limit rows or hide Other Sections/Disable Infinite Scrolling

RELEVANCE / SCOPE: I like it, and many users of untrap for youtube use this feature.

"SIDE EFFECTS": inconsistent element positioning perhaps, home page may look weird, loading problems ?

CONTEXT: This feature may be similar to one available in Untrap for youtube,

// Thank you!

SHORT Table (Summary)
Problem Lots of unnecessary doom scrolling garbage on home screen, may be better than search page option
Solution count and delete ytd-rich-item-renderer OR Maybe delete all elements after ytd-rich-section-renderer (especially ytd-continuation-item-renderer responsible for doom scrolling)
Scope Home page, near Thumbnails per row option
Side effects May mess with styling
Context Home Page

lalishansh avatar Jun 11 '25 13:06 lalishansh

I guess it should be simple because we already have the logic in place for 4 ~ 8 thumbs, it should be only a matter of adding an option to 3, but I need to check the code, and let you know.

wbalbo avatar Jun 11 '25 17:06 wbalbo

hello can we have a number 0 too so that my youtube screen can be like this

Image

its pretty good for zen workflows eliminating feed distractions

adityacyan avatar Jun 11 '25 17:06 adityacyan

hello @wbalbo sir i have made this via simple edit to code can i send the pull request i have tested this on my machine?

adityacyan avatar Jun 11 '25 18:06 adityacyan

hello @wbalbo sir i have made this via simple edit to code can i send the pull request i have tested this on my machine?

Do you mean the request from @lalishansh? If so, please create a Pull Request, and I can check. I can't merge, though, but @ImprovedTube can.

wbalbo avatar Jun 11 '25 18:06 wbalbo

@adityacyan since you are already working on the code, please add the option to 3 thumbnails per row, as requested by the OP, @lalishansh

wbalbo avatar Jun 12 '25 11:06 wbalbo

Ok i will add the 3 thumbnail one

adityacyan avatar Jun 12 '25 12:06 adityacyan

for @lalishansh's wish, we can try to limit the number of thumbnail tile and sections to 11 and 1:

#contents > ytd-rich-item-renderer:nth-child(n + 12) , #contents > ytd-rich-section-renderer:nth-child(n + 2) { display: none !important; }

(Tested.) So CSS is convenient. besides that we need JS if CSS cant do everything, it doesnt consider if the ytd-rich-items are actually grandchildren elements and children of #contents > ytd-rich-section-renderer, nor if you also hide some of those by our feature to hide shorts.

       function hideTiles(selector, max) {  const tiles = document.querySelectorAll(selector); 
      tiles.forEach((e, i) => {   if (i >= max) e.style.display = 'none';   });  }
 
      hideTiles('#dismissible', 5);  hideTiles('ytd-rich-item-renderer', 5);

And then we might also want to prevent / block fetching more tiles when scrolling or re run after yt-page-data-updated
( or else add #contents to our DOM mutation observer )

ImprovedTube avatar Jun 13 '25 09:06 ImprovedTube

how to call this option? home page : show only the first 5 videos ?
@lalishansh

ImprovedTube avatar Jun 13 '25 09:06 ImprovedTube

Yup sounds cool

lalishansh avatar Jun 16 '25 15:06 lalishansh

would do this a little bit later , got some project work to do this week :(

adityacyan avatar Jun 16 '25 17:06 adityacyan