mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-09-22 05:37:56 +02:00
Fixed getting channel ID for invidious.
This commit is contained in:
parent
58c0c6e152
commit
5471273673
1 changed files with 6 additions and 6 deletions
10
content.js
10
content.js
|
@ -518,17 +518,17 @@ function getChannelID() {
|
||||||
|
|
||||||
if (channelNameContainer !== null) {
|
if (channelNameContainer !== null) {
|
||||||
channelURLContainer = channelNameContainer.querySelector("#container").querySelector("#text-container").querySelector("#text").firstElementChild;
|
channelURLContainer = channelNameContainer.querySelector("#container").querySelector("#text-container").querySelector("#text").firstElementChild;
|
||||||
} else {
|
|
||||||
//old YouTube theme
|
|
||||||
let channelContainers = document.getElementsByClassName("yt-user-info");
|
|
||||||
if (channelContainers.length != 0) {
|
|
||||||
channelURLContainer = channelContainers[0].firstElementChild;
|
|
||||||
} else if (onInvidious) {
|
} else if (onInvidious) {
|
||||||
// Unfortunately, the Invidious HTML doesn't have much in the way of element identifiers...
|
// Unfortunately, the Invidious HTML doesn't have much in the way of element identifiers...
|
||||||
channelContainers = document.querySelector("body > div > div.pure-u-1.pure-u-md-20-24 div.pure-u-1.pure-u-lg-3-5 > div > a");
|
channelContainers = document.querySelector("body > div > div.pure-u-1.pure-u-md-20-24 div.pure-u-1.pure-u-lg-3-5 > div > a");
|
||||||
if (channelContainers.length != 0) {
|
if (channelContainers.length != 0) {
|
||||||
channelURLContainer = channelContainers;
|
channelURLContainer = channelContainers;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
//old YouTube theme
|
||||||
|
let channelContainers = document.getElementsByClassName("yt-user-info");
|
||||||
|
if (channelContainers.length != 0) {
|
||||||
|
channelURLContainer = channelContainers[0].firstElementChild;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue