youtube icon indicating copy to clipboard operation
youtube copied to clipboard

Add setting to hide AI summary below YouTube player (#2901)

Open Keerthi421 opened this issue 8 months ago • 5 comments

📝 Pull Request Description

This PR implements the feature requested in #2901 — to allow users to hide the new AI-generated summary that appears below the YouTube video player, between the description and the comments. ✔️ Summary of Changes

  1. Settings Toggle: -->Added a new user-facing option Hide AI summary below player to the General section of the extension settings. -->The setting is labeled hide_ai_summary and is fully localized (_locales/en/messages.json).

  2. Hiding Logic via CSS and JavaScript: --> A CSS rule was added in both styles.css and general.css targeting the AI summary container ([target-id*="description"]). -->This rule hides the section when the root element has the attribute it-hide-ai-summary="true". --.A feature handler (extension.features.hideAISummary) was created to read the setting and toggle this attribute accordingly.

  3. Initialization and Messaging: -->init.js calls hideAISummary() on every YouTube page load to apply the setting instantly. -->The background script listens for changes to the setting and messages all active YouTube tabs. -->The content script responds by re-running the feature logic, applying the change dynamically without a page reload.

  4. Future-Proofing & Performance: -->Used a flexible CSS selector ([target-id*="description"]) to handle potential changes in YouTube’s DOM structure. -->Messaging is limited to YouTube tabs only for efficiency. -->Basic error handling added to ensure stable message passing.

🎯 Why This Solves the Issue

The changes directly implement the request in #2901 by: -->Providing a clear toggle option for users -->Hiding the AI summary panel only when enabled This gives users the exact control they asked for — to remove the AI summary section if they don’t want to see it. closes issue #2901

Keerthi421 avatar Apr 20 '25 10:04 Keerthi421

Hi and thank you for all your work! @Keerthi421 sorry i'm late this time, looking forward

ImprovedTube avatar Apr 30 '25 15:04 ImprovedTube

just adding your css for today https://github.com/code-charity/youtube/commit/053c9eb29243441438cad720501250c1ba7f1ebe https://github.com/code-charity/youtube/commit/87f16c5ef5789428171fbf448c4fbd8f8ff54762

hope you will be back thank you again!

ImprovedTube avatar May 13 '25 07:05 ImprovedTube

Its not working, AI summary still there after setting enable:

image

Saxombie avatar May 31 '25 04:05 Saxombie

hi @Saxombie, thanks, please test this: https://github.com/Keerthi421/youtube/archive/refs/heads/master.zip (unpacked at chrome://extensions)

ImprovedTube avatar May 31 '25 20:05 ImprovedTube

hi @Saxombie, thanks, please test this: https://github.com/Keerthi421/youtube/archive/refs/heads/master.zip (unpacked at chrome://extensions)

Still not working.. and it even shows "errors" on Chrome extensions page:

image

Saxombie avatar May 31 '25 23:05 Saxombie