From 547127367313b05dcb64ba9750953ebe3a3e6c0a Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 19 Dec 2019 00:48:26 -0500 Subject: [PATCH] Fixed getting channel ID for invidious. --- content.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content.js b/content.js index 6421f53f..0ddea4a9 100644 --- a/content.js +++ b/content.js @@ -518,17 +518,17 @@ function getChannelID() { if (channelNameContainer !== null) { channelURLContainer = channelNameContainer.querySelector("#container").querySelector("#text-container").querySelector("#text").firstElementChild; + } else if (onInvidious) { + // 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"); + if (channelContainers.length != 0) { + channelURLContainer = channelContainers; + } } else { //old YouTube theme let channelContainers = document.getElementsByClassName("yt-user-info"); if (channelContainers.length != 0) { channelURLContainer = channelContainers[0].firstElementChild; - } else if (onInvidious) { - // 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"); - if (channelContainers.length != 0) { - channelURLContainer = channelContainers; - } } }