From 9b898af440ba710fb9a402df87da676776fcea4c Mon Sep 17 00:00:00 2001 From: goodtube4u Date: Thu, 16 Oct 2025 09:13:44 +1000 Subject: [PATCH] Hide AI summaries option --- README.md | 1 + goodtube.js | 43 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 402ac4b..22868b8 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ It also provides a few additional options: - Hide end screen suggested videos - Hide sidebar suggested videos - Hide comments +- Hide AI summaries - Always play videos from the start *These can be accessed via the custom settings menu. You will find this down the bottom right of Youtube when installed.* diff --git a/goodtube.js b/goodtube.js index 2b3d84a..840d76c 100644 --- a/goodtube.js +++ b/goodtube.js @@ -241,6 +241,13 @@ goodTube_hideComments = 'false'; } + // Are AI summaries enabled? + let goodTube_hideAiSummaries = goodTube_helper_getCookie('goodTube_hideAiSummaries'); + if (!goodTube_hideAiSummaries) { + goodTube_helper_setCookie('goodTube_hideAiSummaries', 'false'); + goodTube_hideAiSummaries = 'false'; + } + // Always play videos from the start? let goodTube_alwaysStart = goodTube_helper_getCookie('goodTube_alwaysStart'); if (!goodTube_alwaysStart) { @@ -386,7 +393,6 @@ console.log('[GoodTube] Suggested videos removed'); } - // Hide comments if they're not enabled if (goodTube_hideComments === 'true') { cssOutput += ` @@ -401,6 +407,18 @@ console.log('[GoodTube] Comments removed'); } + // Hide AI summaries if they're not enabled + if (goodTube_hideAiSummaries === 'true') { + cssOutput += ` + ytd-expandable-metadata-renderer[has-video-summary] { + display: none !important; + } + `; + + // Debug message + console.log('[GoodTube] AI summaries removed'); + } + // Add the styles to the page let style = document.createElement('style'); style.textContent = cssOutput; @@ -1677,6 +1695,11 @@ hideComments = ' checked'; } + let hideAiSummaries = ''; + if (goodTube_hideAiSummaries === 'true') { + hideAiSummaries = ' checked'; + } + let alwaysStart = ''; if (goodTube_alwaysStart === 'true') { alwaysStart = ' checked'; @@ -1728,7 +1751,12 @@ -
+
+ + +
+ +
@@ -2261,6 +2289,17 @@ } } + // Hide AI summaries + let goodTube_setting_hideAiSummaries = document.querySelector('.goodTube_option_hideAiSummaries'); + if (goodTube_setting_hideAiSummaries) { + if (goodTube_setting_hideAiSummaries.checked) { + goodTube_helper_setCookie('goodTube_hideAiSummaries', 'true'); + } + else { + goodTube_helper_setCookie('goodTube_hideAiSummaries', 'false'); + } + } + // Always play videos from the start let goodTube_setting_alwaysStart = document.querySelector('.goodTube_option_alwaysStart'); if (goodTube_setting_alwaysStart) {