Add Feature - Remove Rich Shelves Entirely#207
Add Feature - Remove Rich Shelves Entirely#207tummyslyunopened wants to merge 2 commits intoOsaSoft:masterfrom
Conversation
There was a problem hiding this comment.
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.sectionswith a default value offalse - 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"); |
There was a problem hiding this comment.
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).
| let richSections = document.querySelectorAll(".ytd-rich-section-renderer"); | |
| let richSections = document.querySelectorAll("ytd-rich-section-renderer"); |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.