Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouChoose

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.

Features

  • 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.

Installation

  1. Download the Extension:

    • Clone this repository: git clone https://github.com/Musavirkhaliq/YouChoose.git
    • Or download the ZIP and extract it.
  2. 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.

Usage

  1. Open YouTube: Visit www.youtube.com or any video page.
  2. 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.
  3. 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.

Example Keywords

  • Allow: tutorial, lesson, explained, how to, learn, education, science, math, history, programming, lecture, course
  • Block: prank, funny, fail, reaction, gaming, vlog, challenge

Files Overview

  • 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).

Customization and Development

  • Edit Defaults: Open content.js and modify defaultAllowKeywords or defaultBlockKeywords arrays.
  • 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 in content.js.
    • Adjust selectors in content.js if YouTube updates their UI (use Chrome DevTools to inspect elements).
  • 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).

Limitations

  • 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.

Contributing

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.

License

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! 🚀

About

Filters YouTube recommendations to show only educational or preferred content based on keywords.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages