Skip to content

Commit

Permalink
Fix related videos on watch page on new layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Oct 23, 2024
1 parent d1dfad7 commit 7b70a0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/thumbnails/thumbnailRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,8 @@ export async function replaceThumbnail(element: HTMLElement, videoID: VideoID, b
image.parentElement?.appendChild?.(thumbnail);
}

if (onMobile()) {
// 2024 Oct UI needs to replacement setup
if (onMobile() || image.parentElement?.classList?.contains("yt-thumbnail-view-model__image")) {
addNodeToListenFor(thumbnail, MobileFix.Replace);
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/videoBranding/videoBranding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface VideoBrandingInstance {
}

export const brandingBoxSelector = !onMobile()
? "ytd-rich-grid-media, ytd-video-renderer, ytd-movie-renderer, ytd-compact-video-renderer, ytd-compact-radio-renderer, ytd-compact-movie-renderer, ytd-playlist-video-renderer, ytd-playlist-panel-video-renderer, ytd-grid-video-renderer, ytd-grid-movie-renderer, ytd-rich-grid-slim-media, ytd-radio-renderer, ytd-reel-item-renderer, ytd-compact-playlist-renderer, ytd-playlist-renderer, ytd-grid-playlist-renderer, ytd-grid-show-renderer, ytd-structured-description-video-lockup-renderer, ytd-hero-playlist-thumbnail-renderer, ytd-rich-item-renderer"
? "ytd-rich-grid-media, ytd-video-renderer, ytd-movie-renderer, ytd-compact-video-renderer, ytd-compact-radio-renderer, ytd-compact-movie-renderer, ytd-playlist-video-renderer, ytd-playlist-panel-video-renderer, ytd-grid-video-renderer, ytd-grid-movie-renderer, ytd-rich-grid-slim-media, ytd-radio-renderer, ytd-reel-item-renderer, ytd-compact-playlist-renderer, ytd-playlist-renderer, ytd-grid-playlist-renderer, ytd-grid-show-renderer, ytd-structured-description-video-lockup-renderer, ytd-hero-playlist-thumbnail-renderer, ytd-rich-item-renderer, yt-lockup-view-model"
: "ytm-video-with-context-renderer, ytm-compact-radio-renderer, ytm-reel-item-renderer, ytm-channel-featured-video-renderer, ytm-compact-video-renderer, ytm-playlist-video-renderer, .playlist-immersive-header-content, ytm-compact-playlist-renderer, ytm-video-card-renderer, ytm-vertical-list-renderer, ytm-playlist-panel-video-renderer";

export const watchPageThumbnailSelector = ".ytp-cued-thumbnail-overlay";
Expand Down

0 comments on commit 7b70a0b

Please sign in to comment.