mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 19:47:04 +03:00
20 lines
565 B
TypeScript
20 lines
565 B
TypeScript
export function getControls(): HTMLElement | false {
|
|
const controlsSelectors = [
|
|
// YouTube
|
|
".ytp-right-controls",
|
|
// Mobile YouTube
|
|
".player-controls-top",
|
|
// Invidious/videojs video element's controls element
|
|
".vjs-control-bar",
|
|
];
|
|
|
|
for (const controlsSelector of controlsSelectors) {
|
|
const controls = document.querySelectorAll(controlsSelector);
|
|
|
|
if (controls && controls.length > 0) {
|
|
return <HTMLElement> controls[controls.length - 1];
|
|
}
|
|
}
|
|
|
|
return false;
|
|
} |