Skip to content

Validation to hide Shorts on the Subscriptions page, in List mode.#2983

Merged
ImprovedTube merged 1 commit intocode-charity:masterfrom
wbalbo:fix-hide-subscription-shorts
Jun 4, 2025
Merged

Validation to hide Shorts on the Subscriptions page, in List mode.#2983
ImprovedTube merged 1 commit intocode-charity:masterfrom
wbalbo:fix-hide-subscription-shorts

Conversation

@wbalbo
Copy link
Contributor

@wbalbo wbalbo commented Jun 4, 2025

This should solve the issue #2982

The old code is working but only for the Grid mode. In List mode, a different class is used, and the property "is-shorts" doesn't exist.

YouTube being YouTube.

Tested on Chrome and Edge, but should work for all browsers, since is a CSS issue with fixed named elements.

@wbalbo wbalbo requested a review from ImprovedTube June 4, 2025 20:44
@ImprovedTube
Copy link
Member

thank you!

@ImprovedTube ImprovedTube merged commit 9588fe8 into code-charity:master Jun 4, 2025
1 check passed
@ImprovedTube
Copy link
Member

..here i go again 😀 (@wbalbo)

This list is nice: https://github.com/gijsdev/ublock-hide-yt-shorts/blob/ab95b4ede2f7a6d15339a9017fab7a843d9ca24d/list.txt#L9-L61 (@gijsdev) and free, MIT license

It got "its attention"* here https://www.youtube.com/watch?v=Nfr0uIU2lDI

Thus this and our version both should be mutually included and worked on together bi-directionally.

The whole feature might never was strictly and lastingly maintained by more than 0 people.
(Yet it probably already exists in several, mostly abandonned versions).

Yet we are in for a longer run.
With any structure, a shared (ranked) to-do list, volunteers and parteon or other funding will have the capacity to guarantee (proportionally reasonably) even much less relevant and much more complex features.


...*

(Society, including users and developers, seemingly can have a synced emotion / behavior - at least when changes are imposed at once.) This event also was how @ChrisTitusTech learned about ImprovedTube: https://www.youtube.com/watch?v=SLfff7Kw_Xc, yet the world didn't. (Only a small fraction of his audience did. And the thumbnail "2019 youtube" didn't try to describe it beyond one specific emotion)

Another example: https://chromewebstore.google.com/detail/unhook-remove-youtube-rec/khncfooichmfjbepaaaebmommgaepoid (@alisonchou) (which technically is a "display:none" project and an easy/efficient sub-set of our mission. And technically applying the same method of adding attributes to the root element)
(Yet thats easier to understand and much more efficient work than our's yet ( amount_of_users/KB_of_code ratio )

**UNHOOK:**
#masthead-ad.ytd-rich-grid-renderer.style-scope,div#home-page-skeleton,
html[hide_annotations=true] .annOption,
html[hide_autoplay=true] .autonav-endscreen,
html[hide_autoplay=true] button[data-tooltip-target-id=ytp-autonav-toggle-button],
html[hide_autoplay=true] ytd-watch-flexy:not([playlist]) .ytp-chrome-controls .ytp-next-button,
html[hide_bar=true] #actions.ytd-watch-metadata,
html[hide_bar=true] #info>#menu-container,
html[hide_cards=true] .ytp-ce-element,
html[hide_channel=true] #owner.ytd-watch-metadata,
html[hide_channel=true] #top-row.ytd-video-secondary-info-renderer,
html[hide_channel=true][hide_desc=true] #primary-inner>#meta,
html[hide_chat=true] ytd-live-chat-frame#chat,
html[hide_comments=true] #comment-teaser,
html[hide_comments=true] #comments,
html[hide_desc=true] #description.ytd-watch-metadata,
html[hide_desc=true] ytd-expander.ytd-video-secondary-info-renderer,
html[hide_donate=true] #donation-shelf,
html[hide_endscreen=true] .
html5-endscreen:not(.mweb-endscreen),
html[hide_feed=true] ytd-browse[page-subtype=home] .ytd-rich-grid-renderer,
html[hide_feed=true] ytd-browse[role=main]:not([page-subtype]):not(:has(#header #page-header-container)):has(ytd-feed-filter-chip-bar-renderer) .ytd-rich-grid-renderer,
html[hide_header=true] #guide-spacer,
html[hide_header=true] #masthead-container,
html[hide_merch=true] #clarify-box,
html[hide_merch=true] #offer-module,
html[hide_merch=true] #ticket-shelf,
html[hide_merch=true] .ytp-drawer,
html[hide_merch=true] yt-alert-with-actions-renderer,
html[hide_merch=true] ytd-merch-shelf-renderer,
html[hide_merch=true] ytd-metadata-row-container-renderer>#always-shown,
html[hide_meta=true] #primary-inner>#info,
html[hide_meta=true] ytd-watch-metadata,
html[hide_mix=true] .ytp-videowall-still[data-is-mix=true],
html[hide_mix=true] a[href*="start_radio=1"],
html[hide_mix=true] ytd-browse[page-subtype=home] ytd-video-meta-block[radio-meta],
html[hide_mix=true] ytd-compact-radio-renderer,
html[hide_mix=true] ytd-radio-renderer,
html[hide_mix=true] ytd-rich-item-renderer:has(a[href*="start_radio=1"]),
html[hide_moreyt=true] #sections>ytd-guide-section-renderer:nth-last-child(2),
html[hide_notifs=true] #buttons.ytd-masthead>ytd-notification-topbar-button-renderer.ytd-masthead,
html[hide_notifs=true] ytd-notification-topbar-button-shape-renderer,
html[hide_playlists=true] #playlist,
html[hide_prof=true] .ytd-comment-renderer yt-img-shadow,
html[hide_recommended=true] #items.ytd-watch-next-secondary-results-renderer,
html[hide_recommended=true] .ytd-watch-grid>#contents,
html[hide_recommended=true] .ytp-pause-overlay,
html[hide_redirect_home=true][hide_feed=true][hide_subs=false] .yt-simple-endpoint[href="/"],
html[hide_redirect_home=true][hide_feed=true][hide_subs=false] .yt-simple-endpoint[href^="/index"],
html[hide_search=true] #primary>.ytd-two-column-search-results-renderer ytd-horizontal-card-list-renderer,
html[hide_search=true] #primary>.ytd-two-column-search-results-renderer ytd-shelf-renderer,
html[hide_shorts=true] .yt-simple-endpoint[title=Shorts],
html[hide_sidebar=true] #secondary.ytd-watch-flexy,
html[hide_subs=true] .yt-simple-endpoint[href^="/feed/subscriptions"],
html[hide_subs=true]:not([yt-signed-out]) #sections>ytd-guide-section-renderer:nth-child(2),
html[hide_subs=true] ytd-browse[page-subtype=subscriptions],
html[hide_trending=true] .yt-simple-endpoint[href^="/feed/explore"],
html[hide_trending=true] .yt-simple-endpoint[href^="/feed/trending"],
html[hide_trending=true]:not([yt-signed-out]) #sections>ytd-guide-section-renderer:nth-child(3),
html[hide_trending=true][yt-signed-out] #sections>ytd-guide-section-renderer:nth-child(4),
html[hide_trending=true] ytd-browse[page-subtype=trending],paper-dialog>ytd-single-option-survey-renderer[dialog][dialog][dialog],ytd-mealbar-promo-renderer[dialog],ytd-primetime-promo-renderer,
html[hide_header=true] #header.ytd-c4-tabbed-header-renderer,
html[hide_header=true] #page-manager.ytd-app{margin-top:0!important}
html[hide_header=true] ytd-mini-guide-renderer.ytd-app{top:0!important}
html[hide_channel=true][hide_desc=false] ytd-video-primary-info-renderer{border:0!important}
html[hide_sidebar=true] ytd-watch-flexy[flexy][is-two-columns_]:not([fullscreen]):not([theater]){--ytd-watch-flexy-max-player-width:calc(var(--ytd-watch-flexy-chat-max-height)*var(--ytd-watch-flexy-width-ratio)/var(--ytd-watch-flexy-height-ratio))!important}#content>#page-manager.ytd-app{overflow-y:hidden!important}#surveys,.mealbar-promo-renderer,
html[hide_autoplay=true] .player-controls-middle>button:not(.player-control-play-pause-icon),
html[hide_autoplay=true] .ytm-autonav-bar,
html[hide_autoplay=true] .ytm-autonav-toggle-button-container,
html[hide_bar=true] .slim-video-metadata-actions,
html[hide_channel=true] ytm-slim-owner-renderer,
html[hide_comments=true] ytm-comment-section-renderer,
html[hide_comments=true] ytm-comments-entry-point-header-renderer,
html[hide_comments=true] ytm-engagement-panel,
html[hide_desc=true] .slim-video-metadata-header-content>c3-icon,
html[hide_desc=true] .slim-video-metadata-info,
html[hide_donate=true] ytm-donation-shelf-renderer-outer,
html[hide_endscreen=true] .ytp-mweb-endscreen-play-next,
html[hide_endscreen=true] .ytp-mweb-endscreen-play-previous,
html[hide_feed=true] div[tab-identifier=FEwhat_to_watch],
html[hide_header=true] .mobile-topbar-header,
html[hide_merch=true] ytm-compact-offer-module-renderer,
html[hide_meta=true] ytm-item-section-renderer[section-identifier=slim-video-metadata],
html[hide_mix=true] ytm-compact-radio-renderer,
html[hide_mix=true] ytm-radio-renderer,
html[hide_playlists=true] ytm-playlist,
html[hide_prof=true] .comment-icon-container,
html[hide_recommended=true] ytm-item-section-renderer[section-identifier=related-items],
html[hide_redirect_home=true][hide_feed=true][hide_subs=false] ytm-pivot-bar-renderer>ytm-pivot-bar-item-renderer:has(.pivot-w2w),
html[hide_shorts=true] ytm-pivot-bar-renderer>ytm-pivot-bar-item-renderer:has(.pivot-shorts),
html[hide_subs=true] div[tab-identifier=FEsubscriptions],
html[hide_subs=true] ytm-pivot-bar-renderer>ytm-pivot-bar-item-renderer:has(.pivot-subs),
html[hide_trending=true] div[tab-identifier=FEexplore],
html[hide_trending=true] div[tab-identifier=FEtrending],
html[hide_trending=true] ytm-pivot-bar-renderer>ytm-pivot-bar-item-renderer:has(.pivot-trending),
html[hide_recommended=true] #secondary.ytd-watch-grid{overflow-x:hidden;overflow-y:auto;min-height:300px}
html[hide_header=true] #player-container-id,
html[hide_header=true] ytm-item-section-renderer[section-identifier=related-items]{top:0!important}
html[hide_header=true] ytm-app.sticky-player{padding-top:0!important}
html[hide_shorts=true] #player-shorts-container,
html[hide_shorts=true] .ytd-shorts,
html[hide_shorts=true] yt-chip-cloud-chip-renderer:has(yt-formatted-string[title=Shorts]),
html[hide_shorts=true] yt-tab-shape[tab-title=Shorts],
html[hide_shorts=true] ytd-compact-video-renderer:has(a[href*="/shorts/"]),
html[hide_shorts=true] ytd-notification-renderer:has(>a[href^="/shorts/"]),
html[hide_shorts=true] ytd-reel-shelf-renderer,
html[hide_shorts=true] ytd-rich-grid-renderer[is-shorts-grid],
html[hide_shorts=true] ytd-rich-item-renderer:has(a[href*="/shorts/"]),
html[hide_shorts=true] ytd-rich-shelf-renderer[is-shorts],
html[hide_shorts=true] ytd-video-renderer:has(a[href*="/shorts/"]),
html[hide_shorts=true] ytm-reel-shelf-renderer,
html[hide_shorts=true] ytm-rich-grid-renderer.is_shorts,
html[hide_shorts=true] ytm-video-with-context-renderer:has(a[href*="/shorts/"])
{display:none!important} 

compare: https://github.com/search?q=repo%3Acode-charity%2Fyoutube+AND+%28%22display%3A+none%22+OR+%22display%3Anone%22%29&type=code

Thanks

@wbalbo
Copy link
Contributor Author

wbalbo commented Jun 5, 2025

Yeah, I guess it could be good to have a nice to-do list supported by people, but the difficulty is to convince them to support, as you said, with a Patreon or something like that.

Maybe convincing some huge YouTuber to share the extension, like you shared the videos above?

But to change/refactor the entire structure of Improve it will be a huge work, that will take a lot of time and effort.

@ImprovedTube
Copy link
Member

ImprovedTube commented Jun 5, 2025

hi :) yes, maybe LinusTechTips next? (does he have Github yet?)

For example if you search "hide" in improvedtube, then the filtered view might be the most similar existing thing to Unhook.

Will update myself how the best / most laborious uBlock lists are collaborated
and probably release a crowdsourcing version of uBlock.

@wbalbo
Copy link
Contributor Author

wbalbo commented Jun 5, 2025

hi :) yes, maybe LinusTechTips next? (does he have Github yet?)

For example if you search "hide" in improvedtube, then the filtered view might be the most similar existing thing to Unhook.

Will update myself how the best / most laborious uBlock lists are collaborated and probably release a crowdsourcing version of uBlock.

Let me know, and if I have some time, I would probably have for now, since I am looking for a new job in the IT area, I can help.

@ImprovedTube
Copy link
Member

opened this the other day 😀 https://github.com/code-charity/display-none

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