Skip to content

Add Feature - Remove Rich Shelves Entirely#207

Open
tummyslyunopened wants to merge 2 commits intoOsaSoft:masterfrom
tummyslyunopened:206-remove-rich-shelves
Open

Add Feature - Remove Rich Shelves Entirely#207
tummyslyunopened wants to merge 2 commits intoOsaSoft:masterfrom
tummyslyunopened:206-remove-rich-shelves

Conversation

@tummyslyunopened
Copy link

Addresses #206

Removes Rich Shelves entirely, currently found to remove shorts, playables, and Youtube surveys from home and subscriptions feed.

This is not reversed with the Hide Watched toggle. Due to these elements locking up the discovery of videos below these elements I have chosen to remove them entirely instead of hiding them.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new feature to remove rich sections (YouTube UI elements containing shorts, playables, and surveys) from the subscriptions and home feeds. This addresses issue #206 where the existing hide shorts functionality was incomplete and caused the extension to malfunction for videos below shorts shelves.

Changes:

  • Added a new user setting settings.remove.rich.sections with a default value of false
  • Implemented logic to remove all rich section elements from the page using DOM manipulation
  • Added a UI checkbox in the settings page to control this feature

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
common.js Added default setting for the new remove rich sections feature
subs.js Initialized the removeRichSections variable from settings on page load
subs-ui.js Added logic to query and remove rich section elements from the DOM
pages/settings/settings.html Added checkbox and label for the new feature in the settings UI

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

function removeWatchedAndAddButton() {
log("Removing watched from feed and adding overlay");

let richSections = document.querySelectorAll(".ytd-rich-section-renderer");
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selector .ytd-rich-section-renderer uses a class selector (dot prefix) when it should use an element selector. YouTube uses custom elements with names like ytd-rich-section-renderer, not CSS classes. This selector should be ytd-rich-section-renderer without the dot, matching the pattern used on line 272 in the same file and throughout the codebase (see queries.js lines 3-7 for examples).

Suggested change
let richSections = document.querySelectorAll(".ytd-rich-section-renderer");
let richSections = document.querySelectorAll("ytd-rich-section-renderer");

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants