Make skip notice work on channel trailer

This commit is contained in:
Ajay
2021-12-28 11:58:05 -05:00
committed by Michael C
parent 6930980a4d
commit aca52abefc
2 changed files with 25 additions and 5 deletions

View File

@@ -17,4 +17,19 @@ export function getControls(): HTMLElement | false {
}
return false;
}
export function isVisible(element: HTMLElement): boolean {
return element.offsetWidth > 0 && element.offsetHeight > 0;
}
export function findValidElement(selectors: string[]): HTMLElement {
for (const selector of selectors) {
const element = document.querySelector(selector) as HTMLElement;
if (element && isVisible(element)) {
return element;
}
}
return null;
}