fix: show seekbar on embedded YouTube players#3596
Open
niveshdandyan wants to merge 1 commit intocode-charity:masterfrom
Open
fix: show seekbar on embedded YouTube players#3596niveshdandyan wants to merge 1 commit intocode-charity:masterfrom
niveshdandyan wants to merge 1 commit intocode-charity:masterfrom
Conversation
The seekbar, progress bar, and player controls were not appearing on embedded YouTube players (e.g., on third-party sites like Discogs) because the CSS rule for hiding controls on small-mode players was also applying to embedded players. Changes: - Modified CSS selectors to exclude embedded players (it-pathname starting with /embed) from the control-hiding rules for ytp-small-mode - Added 'embed' as a recognized page type in the pageType() function for better embedded player detection Fixes code-charity#3594 Co-Authored-By: Claude (claude-opus-4-5) <noreply@anthropic.com>
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
Fixes seekbar visibility on embedded YouTube players (e.g., Discogs YouTube Player).
The seekbar, progress bar, video duration, and other player controls were not appearing on embedded YouTube players because the CSS rule that hides controls on small-mode players (used for YouTube's native miniplayer) was also being applied to embedded players on third-party sites.
Fixes #3594
Changes
player.cssto exclude embedded players (detected viait-pathnamestarting with/embed) from the control-hiding rules forytp-small-modeplayers'embed'as a recognized page type in thepageType()function infunctions.jsfor better embedded player detection and potential future enhancementsRoot Cause Analysis
The issue was in
js&css/extension/www.youtube.com/appearance/player/player.csslines 43-57. The CSS rule:was hiding the entire
.ytp-chrome-bottomelement (which contains the seekbar, progress bar, and controls) for all players with theytp-small-modeclass. Embedded YouTube players on third-party sites often have this class when displayed in smaller sizes.Technical Details
it-pathnameattribute (set by the extension fromlocation.pathname) to detect embedded players/embed/VIDEO_ID, so we usehtml:not([it-pathname^="/embed"])to exclude them from the hiding ruleTesting
/embed/)AI Transparency
This PR was created with the assistance of AI (Claude by Anthropic) for code generation and review.