diff --git a/maze-utils b/maze-utils index 2a80b1e..6aeaa78 160000 --- a/maze-utils +++ b/maze-utils @@ -1 +1 @@ -Subproject commit 2a80b1eaa7f2adec9555d70f995ce7c1b70623b0 +Subproject commit 6aeaa7836928c091712e0a94167cf78ddb8159b4 diff --git a/src/video.ts b/src/video.ts index dbd2d56..cac00e5 100644 --- a/src/video.ts +++ b/src/video.ts @@ -94,7 +94,8 @@ export function setupCBVideoModule(): void { resetValues, windowListenerHandler, newVideosLoaded, - documentScript: chrome.runtime.getManifest().manifest_version === 2 ? documentScript : undefined + documentScript: chrome.runtime.getManifest().manifest_version === 2 ? documentScript : undefined, + allowClipPage: true }, () => Config); if (onMobile()) { diff --git a/src/videoBranding/videoBranding.ts b/src/videoBranding/videoBranding.ts index 4ddfbcb..a0083cf 100644 --- a/src/videoBranding/videoBranding.ts +++ b/src/videoBranding/videoBranding.ts @@ -60,18 +60,19 @@ const threeRingLogo = chrome.runtime.getURL("icons/logo.svg"); const videoBrandingInstances: Record = {} export async function replaceCurrentVideoBranding(): Promise<[boolean, boolean]> { - const onWatchPage = document.URL.includes("/watch"); + const onClipPage = document.URL.includes("/clip/"); + const onWatchPage = document.URL.includes("/watch") || onClipPage; const onEmbedPage = document.URL.includes("/embed/"); const possibleSelectors = getPossibleSelectors(onWatchPage, onEmbedPage); // Find first invisible one, or wait for the first one to be visible const mainTitle = possibleSelectors.map((selector) => getElement(selector.selector, selector.checkVisibility) as HTMLElement).filter((element) => isVisible(element))[0] || - await waitForElement(possibleSelectors[0].selector, true) as HTMLElement; - const titles = (possibleSelectors.map((selector) => getElement(selector.selector, selector.checkVisibility)).filter((e) => !!e)) as HTMLElement[]; + await waitForElement(possibleSelectors[0].selector, !onClipPage) as HTMLElement; + const titles = (possibleSelectors.map((selector) => getElement(selector.selector, selector.checkVisibility && !onClipPage)).filter((e) => !!e)) as HTMLElement[]; const promises: [Promise, Promise] = [Promise.resolve(false), Promise.resolve(false)] const videoID = getVideoID(); - if (videoID !== null && isVisible(mainTitle)) { + if (videoID !== null && (isVisible(mainTitle) || onClipPage)) { const videoBrandingInstance = getAndUpdateVideoBrandingInstances(videoID, async () => { await replaceCurrentVideoBranding(); }); const brandingLocation = BrandingLocation.Watch;