From f310c53f88ada2cb4db001b8f6833a3d659126b1 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 1 Sep 2019 21:08:29 -0400 Subject: Made sure info menu is not placed in the incorrect container. --- content.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/content.js b/content.js index 1cb7c30e..f0ca78d0 100644 --- a/content.js +++ b/content.js @@ -791,11 +791,18 @@ function openInfoMenu() { //add the close button popup.prepend(closeButton); - let parentNode = document.getElementById("secondary"); + let parentNodes = document.querySelectorAll("#secondary"); + let parentNode = null; + for (let i = 0; i < parentNodes.length; i++) { + if (parentNodes[i].firstElementChild !== null) { + parentNode = parentNodes[i]; + } + } if (parentNode == null) { //old youtube theme parentNode = document.getElementById("watch7-sidebar-contents"); } + //make the logo source not 404 //query selector must be used since getElementByID doesn't work on a node and this isn't added to the document yet -- cgit v1.2.3 From 7deea5d64876a13a7b10ab2f7f2c2278c0d78c30 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 2 Sep 2019 10:54:49 -0400 Subject: Made getChannelID only get called if there is a valid YouTube page. --- content.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content.js b/content.js index f0ca78d0..fb0b13b0 100644 --- a/content.js +++ b/content.js @@ -240,12 +240,12 @@ function videoIDChange(id) { resetValues(); - let channelIDPromise = wait(getChannelID); - channelIDPromise.then(() => channelIDPromise.isFulfilled = true).catch(() => channelIDPromise.isRejected = true) - //id is not valid if (!id) return; + let channelIDPromise = wait(getChannelID); + channelIDPromise.then(() => channelIDPromise.isFulfilled = true).catch(() => channelIDPromise.isRejected = true); + //setup the preview bar if (previewBar == null) { //create it -- cgit v1.2.3 From ef1b96bbf17d38aad32cde10997524fcd841135b Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 2 Sep 2019 21:33:14 -0400 Subject: Update version number --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index ee61dd28..10778193 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "__MSG_Name__", - "version": "1.1.8", + "version": "1.1.9", "default_locale": "en", "description": "__MSG_Description__", "content_scripts": [ -- cgit v1.2.3