Add setting to hide AI summary below YouTube player (#2901)
📝 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
-
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).
-
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.
-
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.
-
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
Hi and thank you for all your work! @Keerthi421 sorry i'm late this time, looking forward
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!
Its not working, AI summary still there after setting enable:
hi @Saxombie, thanks, please test this: https://github.com/Keerthi421/youtube/archive/refs/heads/master.zip (unpacked at chrome://extensions)
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: