A browser extension that filters YouTube content (videos, shorts, playlists, channels, comments) based on keywords and channel names.
- Keyword-based Filtering: Hide videos containing specific keywords in titles
- Uses partial matching (e.g., "apex" will match "apex legends" and "apexlegends")
- Channel-based Filtering: Hide content from specific channels using:
- Channel names (partial matching)
- @handles (exact matching)
- Channel IDs (exact matching with format
channel/ID
orUC...
)
- Multi-format Support: Filter various YouTube content types:
- Regular videos
- Shorts
- Playlists and mixes
- Channel recommendations and channel cards
- Search results
- Hide All Comments: Option to completely hide the comments section
- Keyword-based Comment Filtering: Hide specific comments containing filtered words
- Popup Mode: Quick access via the extension popup
- Tab View: Open in a dedicated tab for more comfortable settings adjustment
- Real-time Filtering: Filters are applied instantly without page refresh
- Visual Feedback: Clear indication when settings are saved
- Password Protection: Optional password protection for parental control
- Import/Export: Save and restore your filter settings
- Download the extension files
- Go to your browser's extension page:
- Chrome:
chrome://extensions/
- Edge:
edge://extensions/
- Opera:
opera://extensions/
- Chrome:
- Enable "Developer mode"
- Click "Load unpacked" and select the extension directory
- Download the extension files
- Go to
about:debugging#/runtime/this-firefox
- Click "Load Temporary Add-on..."
- Select any file from the extension directory
- Click the FilterTube icon in your browser toolbar
- Enter keywords to filter (comma-separated)
- Enter channel names, @handles, or channel/IDs to filter (comma-separated)
- Click "Save" to apply filters
- Go to the channel's page on YouTube
- The URL will be in one of these formats:
https://www.youtube.com/@HandleName
- Use@HandleName
in the filterhttps://www.youtube.com/channel/UCxxxxxxxx
- Usechannel/UCxxxxxxxx
in the filter
- Click the FilterTube icon
- Toggle "Hide all comments" to completely hide comments
- Or select "Filter comments with keywords/channels" to hide only matching comments
In version 2.0.0, FilterTube has been completely refactored to use a revolutionary "Data Interception" approach inspired by successful extensions like BlockTube, fetch-fiddler, Requestly etc. but with completely independent implementation:
-
Data Interception Before Rendering: FilterTube now intercepts YouTube's raw JSON data before it gets processed and rendered to the DOM. This provides:
- True "zero-flash" filtering: Content never appears before being filtered
- Dramatic performance improvement: No DOM scanning/manipulation required
- More reliable filtering: Works directly with YouTube's data structures
- Resilience against YouTube UI changes: DOM-independent filtering
- Cross-browser compatibility: Works identically on Chrome and Firefox
-
Multi-World Script Architecture:
- seed.js: Runs in MAIN world at document_start to establish early data hooks before YouTube scripts load
- content_bridge.js: Runs in isolated extension context, orchestrates script injection and settings relay
- filter_logic.js: Comprehensive filtering engine with rules for all YouTube renderer types
- injector.js: Coordinates MAIN world filtering and communicates with bridge
- background.js: Manages settings storage and compiles filter rules for optimal performance
-
Comprehensive Data Sources Hooked:
window.ytInitialData
: YouTube's initial page data (home, search, watch pages)window.ytInitialPlayerResponse
: Video player initial datawindow.fetch
: YouTube's API calls for dynamic content loadingXMLHttpRequest
: Fallback for additional dynamic content
-
Advanced Filtering Engine:
- Renderer-based filtering: Supports all YouTube content types (
videoRenderer
,richItemRenderer
,channelRenderer
,commentRenderer
, etc.) - Multi-path data extraction: Robust extraction with multiple fallback paths for each data type
- Intelligent channel matching: Handles @handles, channel IDs, and partial name matching
- RegExp keyword filtering: Compiled patterns for efficient keyword matching
- Recursive JSON traversal: Processes deeply nested YouTube data structures
- Renderer-based filtering: Supports all YouTube content types (
The extension still operates entirely in your browser - no data is sent to any external servers. All filtering happens locally with dramatically improved performance and reliability.
Prior to version 2.0.0, FilterTube worked by:
- Scanning YouTube page content for videos, playlists, channels, and comments
- Comparing titles, channel names, and other metadata against your filters
- Hiding elements that match your filter criteria using CSS
- Preserving YouTube's original layout after filtering
The extension uses multiple techniques to extract and match channel information:
- DOM extraction of visible channel elements
- Access to YouTube's internal component data when available
- Caching to improve performance and consistency
- Normalized matching algorithms to handle variations in channel representation
For the most reliable channel filtering:
- Use both the channel ID and @handle when possible
- Use the exact format from the channel URL for specific channels
- Include distinctive parts of channel names for partial matching
- manifest.chrome.json & manifest.firefox.json: Browser-specific MV3 configurations
- js/: JavaScript files
- background.js: Settings management, compiles filter rules
- content_bridge.js: Isolated world script that injects MAIN world scripts
- seed.js: Early-running script that hooks YouTube data sources
- injector.js: Main script that processes intercepted data
- filter_logic.js: Filtering algorithms for YouTube's JSON data
- popup.js: UI interaction logic
- html/: UI files
- popup.html: Extension popup interface
- tab-view.html: Full-page interface
- css/: Styling files
- build.sh: Build script for creating Chrome and Firefox packages
FilterTube now uses a dedicated build script to create packages for both Chrome and Firefox:
# Build for both browsers
./build.sh
# This creates:
# - dist/filtertube-chrome.zip
# - dist/filtertube-firefox.zip
# - dist/filtertube-chrome/ (unpacked)
# - dist/filtertube-firefox/ (unpacked)
- tabs: For opening the tab view
- storage: For saving user preferences
- activeTab: For accessing the current page content
If you encounter any issues or have suggestions for improvements, please open an issue on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.
See CHANGELOG.md for a detailed history of changes and improvements.
YouTube's recommendation algorithms can sometimes surface unwanted content. FilterTube gives you control over what appears in your feed, allowing for a more focused and pleasant viewing experience without distractions or unwanted content.
FilterTube supports both Chrome and Firefox through a browser-specific build process:
- Chrome uses the standard Manifest V3 with
service_worker
for background scripts - Firefox uses Manifest V3 with the
scripts
array for background scripts (Firefox MV3 compatibility)
-
Install dependencies:
npm install
-
For Chrome development:
npm run dev:chrome
-
For Firefox development:
npm run dev:firefox
These commands copy the appropriate manifest file to manifest.json
for local development.
To build packages for both browsers:
npm run build
This creates:
dist/chrome/
- Chrome extension filesdist/firefox/
- Firefox extension filesdist/filtertube-chrome-v*.*.*.zip
- Chrome packagedist/filtertube-firefox-v*.*.*.zip
- Firefox package
To build for a specific browser:
npm run build:chrome
npm run build:firefox