Skip to content

Commit

Permalink
Fix info popup getting behind other div
Browse files Browse the repository at this point in the history
  • Loading branch information
hanydd committed Jan 17, 2024
1 parent 0b22fc4 commit fca5315
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ function openInfoMenu() {

const frame = document.createElement("iframe");
frame.width = "374";
frame.height = "500";
frame.height = "650";
frame.style.borderRadius = "6px";
frame.addEventListener("load", async () => {
frame.contentWindow.postMessage("", "*");
Expand Down Expand Up @@ -2046,15 +2046,15 @@ function openInfoMenu() {

const parentNodeOptions = [{
// Bilibili
selector: ".right-container-inner",
hasChildCheck: true
selector: ".up-panel-container", // append inside avatar container to avoid z-index issue
hasChildCheck: true,
}];
for (const option of parentNodeOptions) {
const allElements = document.querySelectorAll(option.selector) as NodeListOf<HTMLElement>;
const el = option.hasChildCheck ? elemHasChild(allElements) : allElements[0];

if (el) {
if (option.hasChildCheck) el.insertBefore(popup, el.firstChild.nextSibling);
if (option.hasChildCheck) el.appendChild(popup);
break;
}
}
Expand Down

0 comments on commit fca5315

Please sign in to comment.