From e881bf73d8af2346a0fd532bf91b505ff9373512 Mon Sep 17 00:00:00 2001 From: Andrew S Date: Thu, 25 Jan 2024 23:08:52 -0600 Subject: [PATCH] Fix miniplayer on some websites --- chrome/content.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chrome/content.js b/chrome/content.js index 3cdaea15..8f174644 100644 --- a/chrome/content.js +++ b/chrome/content.js @@ -20,6 +20,7 @@ window.addEventListener('message', (e) => { isMini: false, isFullscreen: false, placeholder: null, + oldStyle: '', }); break; } @@ -269,12 +270,12 @@ function makeMiniPlayer(iframeObj) { iframeObj.isMini = true; const element = iframeObj.iframe; - const placeholder = document.createElement('div'); + const placeholder = document.createElement(element.tagName); transferId(element, placeholder); iframeObj.placeholder = placeholder; - iframeObj.oldStyle = element.getAttribute('style'); + iframeObj.oldStyle = element.getAttribute('style') || ''; placeholder.setAttribute('style', iframeObj.oldStyle); placeholder.style.setProperty('background-color', 'black', 'important'); placeholder.classList = element.classList; @@ -297,6 +298,10 @@ function makeMiniPlayer(iframeObj) { z-index: 2147483647 !important; border: 1px solid rgba(0, 0, 0, 0.2) !important; outline: none !important; + top: auto !important; + left: auto !important; + right: auto !important; + bottom: auto !important; `); updateMiniPlayer(iframeObj); }