mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
Made sure info menu is not placed in the incorrect container.
This commit is contained in:
@@ -791,12 +791,19 @@ function openInfoMenu() {
|
|||||||
//add the close button
|
//add the close button
|
||||||
popup.prepend(closeButton);
|
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) {
|
if (parentNode == null) {
|
||||||
//old youtube theme
|
//old youtube theme
|
||||||
parentNode = document.getElementById("watch7-sidebar-contents");
|
parentNode = document.getElementById("watch7-sidebar-contents");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//make the logo source not 404
|
//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
|
//query selector must be used since getElementByID doesn't work on a node and this isn't added to the document yet
|
||||||
let logo = popup.querySelector("#sponsorBlockPopupLogo");
|
let logo = popup.querySelector("#sponsorBlockPopupLogo");
|
||||||
|
|||||||
Reference in New Issue
Block a user