Skip to content

Commit

Permalink
Fix mix handling to be in purely css
Browse files Browse the repository at this point in the history
Fixes slowdown on Firefox and it not working on the homepage
  • Loading branch information
ajayyy committed Dec 20, 2023
1 parent 8c60235 commit 766ee70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
4 changes: 3 additions & 1 deletion public/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,10 @@ ytd-compact-radio-renderer ytd-badge-supported-renderer, ytd-grid-movie-renderer
}

/* These now have a "mix" image in the background, so need a background */
.thumbnailNoBackground ytd-playlist-video-thumbnail-renderer {
ytd-playlist-video-thumbnail-renderer, ytd-playlist-video-renderer a#thumbnail, ytd-compact-radio-renderer a#thumbnail {
background-color: black;
}
ytd-playlist-video-thumbnail-renderer {
border-radius: var(--yt-img-border-radius, none);
}

Expand Down
12 changes: 0 additions & 12 deletions src/videoBranding/videoBranding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ export async function replaceVideoCardBranding(element: HTMLElement, brandingLoc
return [false, false];
}

handleMixes(element, link);

const videoBrandingInstance = getAndUpdateVideoBrandingInstances(videoID,
async () => { await replaceVideoCardBranding(element, brandingLocation, videoID); });
const showCustomBranding = videoBrandingInstance.showCustomBranding;
Expand Down Expand Up @@ -279,16 +277,6 @@ function isPlaylistOrClipTitle(element: HTMLElement, link: HTMLAnchorElement) {
|| link.href?.match(/\/clip\//)?.[0] !== undefined;
}

function handleMixes(element: HTMLElement, link: HTMLAnchorElement): void {
const isMix = !!element.querySelector("yt-collections-stack");

if (isMix) {
link.classList.add("cbMixBg");
} else {
link.classList.remove("cbMixBg");
}
}

export async function handleShowOriginalButton(element: HTMLElement, videoID: VideoID,
brandingLocation: BrandingLocation, showCustomBranding: ShowCustomBrandingInfo,
promises: [Promise<boolean>, Promise<boolean>],
Expand Down

0 comments on commit 766ee70

Please sign in to comment.