set isInvidious to bypass UI bugs

This commit is contained in:
Michael C
2021-11-30 19:13:08 -05:00
parent 5af4833763
commit 6930980a4d

View File

@@ -905,7 +905,12 @@ function getYouTubeVideoID(document: Document): string | boolean {
function getYouTubeVideoIDFromDocument(document: Document): string | boolean {
// get ID from document (channel trailer)
const videoURL = document.querySelector("[data-sessionlink='feature=player-title']")?.getAttribute("href");
return getYouTubeVideoIDFromURL(videoURL);
if (videoURL) {
onInvidious = true;
return getYouTubeVideoIDFromURL(videoURL);
} else {
return false
}
}
function getYouTubeVideoIDFromURL(url: string): string | boolean {