Skip to content

Conversation

@Keerthi421
Copy link

@Keerthi421 Keerthi421 commented Apr 20, 2025

πŸ“ 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

@ImprovedTube
Copy link
Member

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

ImprovedTube added a commit that referenced this pull request May 13, 2025
@ImprovedTube
Copy link
Member

just adding your css for today 053c9eb 87f16c5

hope you will be back
thank you again!

@ImprovedTube ImprovedTube marked this pull request as draft May 13, 2025 07:13
@Saxombie
Copy link

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

image

@ImprovedTube
Copy link
Member

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

@Saxombie
Copy link

Saxombie commented May 31, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants