From 60536ac872d3ea780b97e444d8a52a432f889ded Mon Sep 17 00:00:00 2001 From: throwaway96 <68320646+throwaway96@users.noreply.github.com> Date: Sun, 24 Mar 2024 19:13:52 -0400 Subject: [PATCH] fix UI issues including transparency Based on the following commit: https://github.com/reisxd/TizenTube/commit/8800d1f201a03633e65beb5697cb90ebd15aef3f Co-authored-by: reisxd --- src/ui.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/ui.js b/src/ui.js index 06b7788f..16dcf4cc 100644 --- a/src/ui.js +++ b/src/ui.js @@ -207,3 +207,34 @@ export function showNotification(text, time = 3000) { setTimeout(() => { showNotification('Press [GREEN] to open YTAF configuration screen'); }, 2000); + +function applyUIFixes() { + try { + const bodyClasses = document.body.classList; + + const observer = new MutationObserver(function bodyClassCallback( + _records, + _observer + ) { + try { + if (bodyClasses.contains('app-quality-root')) { + bodyClasses.remove('app-quality-root'); + } + } catch (e) { + console.error('error in class observer callback:', e); + } + }); + + observer.observe(document.body, { + subtree: false, + childList: false, + attributes: true, + attributeFilter: ['class'], + characterData: false + }); + } catch (e) { + console.error('error setting up class observer:', e); + } +} + +applyUIFixes();