🐛 fix: support new YouTube camelCase class names for lockup view models#11
Merged
Conversation
Flaflo
reviewed
Apr 9, 2026
Flaflo
requested changes
Apr 9, 2026
Flaflo
left a comment
Owner
There was a problem hiding this comment.
Thank you very much for this contribution, they really seem to eagerly refactor their class names at the moment for whatever reason.
Can you please update this one suggested change? Thanks!
This was
linked to
issues
Apr 9, 2026
Flaflo
approved these changes
Apr 9, 2026
Flaflo
pushed a commit
that referenced
this pull request
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
YouTube recently updated its DOM structure for video elements (lockup view models), switching from BEM-style class names (e.g.,
.yt-lockup-view-model__content-image) to a new camelCase format (e.g.,.ytLockupViewModelContentImage). This caused the list-view layout to break, resulting in oversized thumbnails and broken grid alignment.This PR introduces "hybrid" support for both naming conventions to ensure the userscript remains functional across different YouTube experiments/rollouts.
Changes
src/core/selectors.tsto include camelCase classes using CSS:is()pseudo-classes.src/ui/style/list-view.cssto apply list-view transformations to the new class names.ytLockupViewModelHoststructure.Technical Details
:is(.yt-lockup-view-model__content-image, .ytLockupViewModelContentImage)and similar patterns to catch the new structure.Disclaimer: This Pull Request was prepared with the assistance of an AI Code Agent (opencode).