From 36078acaee58ee7217ab949f952fef5310ad89dc Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 19 Dec 2019 00:46:37 -0500 Subject: [PATCH] Fixed channel whitelisting on old YouTube. --- content.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/content.js b/content.js index 0d708241..55f2a3ca 100644 --- a/content.js +++ b/content.js @@ -500,14 +500,11 @@ function getChannelID() { //get channel id let channelNameContainer = document.getElementById("channel-name"); - if (channelNameContainer === null) { - //try later - return false; - } + let channelURLContainer = null; - let channelURLContainer = channelNameContainer.querySelector("#container").querySelector("#text-container").querySelector("#text").firstElementChild; - - if (channelURLContainer === null) { + if (channelNameContainer !== null) { + 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) {