From 73f14e581dde16a2bbcbdac2782f2da6ba170cec Mon Sep 17 00:00:00 2001 From: Lucasamiel0406 Date: Mon, 9 Oct 2023 20:56:08 -0300 Subject: [PATCH] Fix Library removed for Premium users As by now, the code removes the last child of the YT's buttons sidebar. It's good for non-premium users but affects premium users, as it removes the "Library" button. This small fix targets the 4th child (usually the Upgrade button location) instead of last child. A bad move/practice, but does its job and remove the Upgrade button while not removing the Library one. --- preload.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preload.ts b/preload.ts index 1886958b..bfa1d467 100644 --- a/preload.ts +++ b/preload.ts @@ -187,7 +187,7 @@ function onApiLoaded() { // Remove upgrade button if (config.get('options.removeUpgradeButton')) { const styles = document.createElement('style'); - styles.innerHTML = `ytmusic-guide-section-renderer #items ytmusic-guide-entry-renderer:last-child { + styles.innerHTML = `ytmusic-guide-section-renderer #items ytmusic-guide-entry-renderer:nth-child(4) { display: none; }`; document.head.appendChild(styles);