A modern browser extension that lets you block unwanted videos on Twitter/X using advanced perceptual hashing technology.
This extension allows you to Control+Click (or Cmd+Click on Mac) any video on Twitter to fingerprint and automatically block similar videos from appearing in your feed. It uses sophisticated video analysis to identify and hide matching content, even when it's re-encoded or slightly modified.
- One-Click Blocking: Cmd/Ctrl+Click on any video to block it and similar content
- Automatic Detection: Smart scanning identifies and hides matching videos as you browse
- Visual Feedback: Toast notifications confirm when videos are blocked
- Advanced Fingerprinting: Uses DCT-based perceptual hashing for reliable matching
- Memory Efficient: Optimized for performance with minimal resource usage
-
Clone or download the repository
git clone https://github.com/yourusername/video-blocker.git
-
Install dependencies
npm install
-
Build the extension
npm run build
-
Load in browser
- Open Chrome/Edge and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
dist/folder
- Open Chrome/Edge and go to
- Navigate to Twitter/X
- Find an unwanted video
- Hold Cmd (Mac) or Ctrl (Windows/Linux) and click on the video
- A toast notification will confirm the video has been blocked
- Similar videos will be automatically blocked as you browse
Access the options page through your browser's extensions menu for:
- View blocking statistics
- Manage blocked video list
- Adjust sensitivity settings
- Import/export your blocklist
esm-src/ ├── constants.js # Configuration settings ├── content.js # Main application coordinator ├── utils/ # Utility modules (logger, storage, UI, etc.) └── core/ # Core functionality modules
This extension is built with modern ES modules and bundled using Vite for optimal performance and maintainability.
Source Structure:
esm-src/
constants.js # Configuration settings
content.js # Main application coordinator
utils/ # Utility modules (logger, storage, UI, etc.)
core/ # Core functionality modules
options/ # Options page HTML/CSS/JS
public/ # Extension icon and static assets
vite.config.js # Vite build configuration
Build Output:
dist/
content.js # Bundled content script
options/ # Bundled options page
manifest.json # Extension manifest (auto-copied)
icon.png, toastify.css # Assets
All code is written as ES modules and bundled for browser compatibility. No legacy JS or CommonJS remains.
npm run dev— Development build with hot reload (Vite)npm run build— Production build (bundles todist/)
The extension provides a comprehensive debug interface via browser console:
// System information
__videoBlockerDebug.getStats();
__videoBlockerDebug.getComponentStatus();
// Video operations
__videoBlockerDebug.scanAllVideos();
__videoBlockerDebug.pauseScanning();
__videoBlockerDebug.resumeScanning();
// Hash management
__videoBlockerDebug.getBlockedHashes();
__videoBlockerDebug.clearAllBlocked();
// Testing Toastify notifications
__videoBlockerDebug.testToast("Custom message", "success");
__videoBlockerDebug.showToastTypes();
__videoBlockerDebug.testToastOffset(50, 100);- Captures multiple frames from video
- Converts to grayscale matrices
- Applies DCT transformation
- Generates binary hash based on frequency patterns
- Uses Hamming distance for similarity matching
- Toast notifications powered by Toastify-js
- Customizable position, duration, and style
- Different gradient styles for success, error, warning, and info notifications
- Chrome 88+ (Manifest V3, ES modules via Vite bundle)
- Microsoft Edge 88+
- Other Chromium-based browsers
- Firefox (with minor adaptations)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Toastify-js for toast notifications
- Built with Vite for modern, efficient bundling
- Uses perceptual hashing techniques inspired by image similarity detection