mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Make skip notice work on channel trailer
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user