A simple Chrome extension to customize your YouTube recommendations by filtering videos based on allow (whitelist) and block (blacklist) keywords. This helps focus on educational or preferred content while removing unwanted distractions like pranks or vlogs—all done client-side without modifying YouTube's servers.
- Keyword-Based Filtering: Define "allow" keywords to show only matching videos (e.g., "tutorial", "science") and "block" keywords to hide unwanted ones (e.g., "funny", "challenge").
- Dynamic Filtering: Automatically updates as you scroll or load new recommendations using MutationObserver.
- Persistent Settings: Keywords are saved via Chrome storage and editable through a popup interface.
- Client-Side Only: No API keys or server interactions required; works by manipulating the page's DOM.
- Customizable Defaults: Edit default keywords in the code for quick setup.
-
Download the Extension:
- Clone this repository:
git clone https://github.com/Musavirkhaliq/YouChoose.git - Or download the ZIP and extract it.
- Clone this repository:
-
Load in Chrome:
- Open Chrome and navigate to
chrome://extensions/. - Enable "Developer mode" in the top right.
- Click "Load unpacked" and select the folder containing the extension files (e.g.,
youchoose). - The extension should appear in your list. Pin it to the toolbar for easy access.
- Open Chrome and navigate to
- Open YouTube: Visit www.youtube.com or any video page.
- Customize Keywords:
- Click the extension icon in your toolbar to open the popup.
- Enter Allow Keywords (one per line) to whitelist content (e.g., educational topics).
- Enter Block Keywords (one per line) to blacklist and remove content.
- Click "Save and Apply" to update. The page will reload automatically.
- Filtering in Action:
- Recommendations on the homepage, sidebar ("Up Next"), and related videos will be hidden if they don't match your allow list or if they match your block list.
- Scroll or refresh to see the filter applied dynamically.
- Allow: tutorial, lesson, explained, how to, learn, education, science, math, history, programming, lecture, course
- Block: prank, funny, fail, reaction, gaming, vlog, challenge
manifest.json: Extension configuration.content.js: The script that runs on YouTube pages to filter recommendations.popup.html: HTML for the settings popup.popup.js: JavaScript for handling popup interactions and storage.icon.png: Optional extension icon (add your own 128x128 PNG).
- Edit Defaults: Open
content.jsand modifydefaultAllowKeywordsordefaultBlockKeywordsarrays. - Advanced Features:
- For more accurate filtering (e.g., by video categories), integrate the YouTube Data API: Get an API key from Google Cloud Console, update permissions in
manifest.json, and add API calls incontent.js. - Adjust selectors in
content.jsif YouTube updates their UI (use Chrome DevTools to inspect elements).
- For more accurate filtering (e.g., by video categories), integrate the YouTube Data API: Get an API key from Google Cloud Console, update permissions in
- Debugging: On YouTube, press F12 to open DevTools, check the Console for logs or errors.
- Build for Production: Zip the folder and submit to the Chrome Web Store (requires a developer account).
- Title-Based Only: Filtering relies on video titles; it may miss nuances (e.g., descriptions or tags). API integration can improve this.
- Client-Side: Doesn't affect YouTube's algorithm—only hides elements after loading. Incognito mode or other browsers may require separate setup.
- Dynamic UI: If YouTube changes class names (e.g.,
ytd-rich-item-renderer), the extension may need updates. - Performance: On very long pages, filtering might cause minor delays, but it's optimized with MutationObserver.
Contributions are welcome! Fork the repo, make changes, and submit a pull request. Ideas:
- Add toggle switch for enabling/disabling.
- Support for regex or case-sensitive matching.
- Integration with YouTube API for category filtering.
This project is licensed under the MIT License. See the LICENSE file for details.
If you encounter issues or have suggestions, open an issue on GitHub! 🚀