aboutsummaryrefslogtreecommitdiffhomepage
path: root/content.js
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2019-09-01 21:08:29 -0400
committerAjay Ramachandran <[email protected]>2019-09-01 21:08:29 -0400
commitf310c53f88ada2cb4db001b8f6833a3d659126b1 (patch)
treef1f58b05c3a121eb4b3c8f20be105e0639667c5a /content.js
parentf2c2fd0d291d4bc089a655307d6185ec522205e6 (diff)
downloadSponsorBlock-f310c53f88ada2cb4db001b8f6833a3d659126b1.tar.gz
SponsorBlock-f310c53f88ada2cb4db001b8f6833a3d659126b1.zip
Made sure info menu is not placed in the incorrect container.
Diffstat (limited to 'content.js')
-rw-r--r--content.js9
1 files changed, 8 insertions, 1 deletions
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