From f37ed4bfd0e0a77dd45cd9fcb8cdf758c6aecd49 Mon Sep 17 00:00:00 2001 From: Otutu Chinedu Kingsley <56305995+otutukingsley@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:12:22 +0000 Subject: [PATCH 1/2] chore: remove front page thumbails by injecting CSS. --- js&css/web-accessible/init.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js&css/web-accessible/init.js b/js&css/web-accessible/init.js index ca6596ca6..9436fabfc 100644 --- a/js&css/web-accessible/init.js +++ b/js&css/web-accessible/init.js @@ -146,6 +146,15 @@ document.addEventListener('yt-navigate-finish', function () { } else if (document.documentElement.dataset.pageType === 'channel') { ImprovedTube.channelPlayAllButton(); } + + // Inject CSS to hide YouTube frontpage thumbnails + const style = document.createElement("style"); + style.textContent = ` + .yt-spec-avatar-shape.yt-spec-avatar-shape__button.yt-spec-avatar-shape__button--button-medium.yt-spec-avatar-shape__button--tappable { + display: none !important; + } + `; + document.head.appendChild(style); }); window.addEventListener('load', function () { From aa004792005d25ae57d135018f724b2cd672262f Mon Sep 17 00:00:00 2001 From: Otutu Chinedu Kingsley <56305995+otutukingsley@users.noreply.github.com> Date: Fri, 15 Nov 2024 09:37:08 +0000 Subject: [PATCH 2/2] hide thumbnail icon using toggle --- _locales/en/messages.json | 3 +++ js&css/extension/www.youtube.com/general/general.css | 5 +++++ js&css/web-accessible/init.js | 9 --------- menu/skeleton-parts/general.js | 5 +++++ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 988af9f18..7fd1de7af 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -683,6 +683,9 @@ "hideVideoTitleFullScreen": { "message": "Hide video title in fullscreen" }, + "hideThumbnailIcon": { + "message": "Hide thumbnail icon" + }, "hideViewsCount": { "message": "Hide views count" }, diff --git a/js&css/extension/www.youtube.com/general/general.css b/js&css/extension/www.youtube.com/general/general.css index 8bdf06e1a..8f64e564f 100644 --- a/js&css/extension/www.youtube.com/general/general.css +++ b/js&css/extension/www.youtube.com/general/general.css @@ -11,6 +11,7 @@ # Mark watched videos # Hide aniamted thubmnails # Hide buttons on thumbnails +# Hide thumbnail icon --------------------------------------------------------------*/ html[it-cursorLighting=true] #below {opacity:.4; transition:3s;} html[it-cursorLighting=true] #below:hover {opacity:1; transition:.5s;} @@ -69,6 +70,10 @@ html[it-hide-animated-thumbnails='true'] #preview>ytd-video-preview, html[it-hide-thumbnail-overlay='true'] #hover-overlays, html[it-hide-thumbnail-overlay='true'] #player-controls.ytd-video-preview, /*-------------------------------------------------------------- +# HIDE THUMBNAIL ICON +--------------------------------------------------------------*/ +html[it-hide-thumbnail-icon='true'] .yt-spec-avatar-shape.yt-spec-avatar-shape__button.yt-spec-avatar-shape__button--button-medium.yt-spec-avatar-shape__button--tappable, +/*-------------------------------------------------------------- # EMBEDDED VIDEOS --------------------------------------------------------------*/ html[it-embeddedHidePauseOverlay='true'] .ytp-pause-overlay, diff --git a/js&css/web-accessible/init.js b/js&css/web-accessible/init.js index 9436fabfc..ca6596ca6 100644 --- a/js&css/web-accessible/init.js +++ b/js&css/web-accessible/init.js @@ -146,15 +146,6 @@ document.addEventListener('yt-navigate-finish', function () { } else if (document.documentElement.dataset.pageType === 'channel') { ImprovedTube.channelPlayAllButton(); } - - // Inject CSS to hide YouTube frontpage thumbnails - const style = document.createElement("style"); - style.textContent = ` - .yt-spec-avatar-shape.yt-spec-avatar-shape__button.yt-spec-avatar-shape__button--button-medium.yt-spec-avatar-shape__button--tappable { - display: none !important; - } - `; - document.head.appendChild(style); }); window.addEventListener('load', function () { diff --git a/menu/skeleton-parts/general.js b/menu/skeleton-parts/general.js index a12841953..0fd11056b 100644 --- a/menu/skeleton-parts/general.js +++ b/menu/skeleton-parts/general.js @@ -196,6 +196,11 @@ extension.skeleton.main.layers.section.general = { text: 'hideThumbnailOverlay', tags: 'preview' }, + hide_thumbnail_icon: { + component: "switch", + text: "hideThumbnailIcon", + tags: "preview", + }, thumbnails_quality: { component: 'select', text: 'thumbnailsQuality',