From afab681a60cb4a6b4acba5ca2fd2221da1e9ba3a Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 13 Sep 2022 11:56:23 -0400 Subject: [PATCH] Fix too many hover text tooltips --- src/js-components/previewBar.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts index e0fa6464..57bf8296 100644 --- a/src/js-components/previewBar.ts +++ b/src/js-components/previewBar.ts @@ -74,6 +74,10 @@ class PreviewBar { setupHoverText(): void { if (this.onMobileYouTube || this.onInvidious) return; + // delete old ones + document.querySelectorAll(`.sponsorCategoryTooltip`) + .forEach((e) => e.remove()); + // Create label placeholder this.categoryTooltip = document.createElement("div"); this.categoryTooltip.className = "ytp-tooltip-title sponsorCategoryTooltip";