Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Typing SVG

πŸ“– Overview

Block-Grab is a professional, dual-purpose browser extension built on Manifest V3. It bundles two independent utility modules into a single lightweight package:

πŸ›‘οΈ AdShield Plus β€” a high-performance ad blocker that combines Chrome's native declarativeNetRequest rule engine with cosmetic DOM filtering to strip out network-level ads and visually hide leftover ad containers.

🎬 HD Video / MP3 Downloader β€” a smart content-grabber that detects active <video> elements on any page, then coordinates with a dedicated Node.js + Express backend to extract streams, convert audio to MP3, or download video up to 4K quality.


✨ Features

πŸ›‘οΈ AdShield Plus

  • ⚑ Native-speed blocking via declarativeNetRequest rules (no slowdown from JS-based interception)
  • 🎯 Cosmetic filtering β€” hides leftover ad containers (.adsbygoogle and similar selectors) directly in the DOM
  • πŸ”’ Live block counter in the popup, tracking total ads blocked per session
  • πŸ”Œ One-click toggle to enable/disable protection instantly
  • 🌐 Works across ad networks like doubleclick.net and other common trackers

🎬 Video / MP3 Downloader

  • πŸ” Auto-detection of active video elements on the current page
  • πŸ“‘ Backend-powered extraction through a Node/Express API
  • 🎡 MP3 audio conversion for audio-only downloads
  • πŸ“Ί Up to 4K video download support with resolution selection
  • 🟒 Floating draggable button (πŸ“₯) that follows you around the page
  • πŸ“Š Real-time progress bar for downloading + merging stages
  • πŸ’Ύ Native Save File to Disk prompt on completion

πŸ—οΈ Architecture

Animated architecture flow diagram

✨ Live data-flow animation β€” glowing dots travel the connector lines to show requests, messages, and files moving through the system in real time.

πŸ“¦ Flow Explained
  1. The content script scans the active page for <video> elements and injects the floating download button.
  2. On click, the popup / floating UI sends a message via the messaging service to the background service worker.
  3. The service worker calls the Node.js + Express backend (http://localhost:5000) with the video/page metadata.
  4. The backend's videoExtractor service resolves stream URLs, the audioConverter handles MP3 conversion if requested, and fileManager assembles the final file in downloads/.
  5. Progress events are streamed back to the extension UI, ending with a Save File to Disk prompt.
  6. In parallel, AdShield Plus runs independently β€” declarativeNetRequest rules block known ad domains at the network layer, while cosmetic CSS filters hide remaining ad containers in the DOM.

πŸ“‚ Repository Structure

β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ downloads/               # Directory where finalized downloads are stored
β”‚   β”œβ”€β”€ temp/                    # Directory for temporary streaming pieces
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/         # Express controllers (download.controller.js)
β”‚   β”‚   β”œβ”€β”€ middleware/          # Error handling (errorHandler.js)
β”‚   β”‚   β”œβ”€β”€ routes/              # Express Router mappings (download.routes.js)
β”‚   β”‚   β”œβ”€β”€ services/            # Services (videoExtractor, audioConverter, fileManager)
β”‚   β”‚   └── server.js            # Node/Express application entry
β”‚   β”œβ”€β”€ .env                     # Server environment settings
β”‚   └── package.json
β”‚
β”œβ”€β”€ extension/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ adblock/              # Rules JSON & Cosmetic CSS filters
β”‚   β”‚   β”œβ”€β”€ assets/                # Icons and images
β”‚   β”‚   β”œβ”€β”€ background/          # Background worker Service Worker
β”‚   β”‚   β”œβ”€β”€ content/                # Page scraper and floating button scripts
β”‚   β”‚   β”œβ”€β”€ popup/                 # Popup page React + HTML
β”‚   β”‚   β”œβ”€β”€ options/              # Options page React + HTML
β”‚   β”‚   β”œβ”€β”€ services/              # Storage, messaging, and API services
β”‚   β”‚   └── styles/                 # Global styling variables & typography
β”‚   β”œβ”€β”€ manifest.json             # MV3 Chrome/Brave Manifest
β”‚   β”œβ”€β”€ vite.config.js              # Multi-page compiler settings
β”‚   β”œβ”€β”€ copy-assets.js            # Asset bundling script
β”‚   └── package.json

🧰 Tech Stack

Layer Technology
Extension UI React, HTML, CSS, Vite (multi-page build)
Extension Core Manifest V3 Service Worker, declarativeNetRequest
Backend API Node.js, Express
Media Processing Custom video extraction & audio conversion services
Storage Local downloads/ & temp/ directories

πŸš€ Installation & Setup

πŸ’‘ The project has two independent pieces β€” the backend server and the browser extension β€” both need to be running for full functionality.

1️⃣ Backend Server Setup

To configure the Express backend server:

# Navigate to the backend directory
cd backend

# Install the Node.js dependencies
npm install

# Start the backend in development mode
npm run dev

The backend server will launch at http://localhost:5000.


2️⃣ Chrome Extension Setup

To compile the Vite/React extension:

# Navigate to the extension directory
cd extension

# Install the development and runtime packages
npm install

# Generate the required icon assets (runs the base64 builder script)
node generate-icons.js

# Build the extension
npm run build

This compiles all React components and packages resources into the static dist/ directory.


3️⃣ Load Extension in Browser (Chrome / Brave / Edge)

1. Open your browser and navigate to: chrome://extensions
2. Enable "Developer mode" (toggle in the top-right corner)
3. Click "Load unpacked" in the top-left
4. Select the extension/dist folder from this directory

βœ… Verifying & Testing

πŸ›‘οΈ Testing the Ad Blocker

  1. Enable the AdShield toggle in the Popup.
  2. Visit any web page containing advertisements (ad-heavy sites or standard layout tests work well).
  3. Watch as requests matching network block rules (e.g. doubleclick.net) get intercepted, and cosmetic selectors (e.g. .adsbygoogle) are visually hidden.
  4. The popup interface tracks the total blocked count live.

🎬 Testing the Video Downloader

  1. Ensure the backend server is running (npm run dev inside backend/).
  2. Play a video on a web page β€” or open the popup, click Video Downloader, then Load Demo Test Video.
  3. A draggable πŸ“₯ button floats in the page's bottom-right corner.
  4. Click the floating icon or the popup option, choose your resolution / MP3 format, and hit Start Download.
  5. Watch the progress bar track downloading + merging, ending in a Save File to Disk prompt.


πŸ—ΊοΈ Roadmap

  • Network-level ad blocking via declarativeNetRequest
  • Cosmetic DOM filtering for residual ad elements
  • Floating draggable download widget
  • MP3 audio extraction & conversion
  • Up to 4K video download support
  • Firefox / Manifest V2 compatibility layer
  • Cloud-based download history sync
  • Custom user-defined block lists

🀝 Contributing

Contributions, issues, and feature requests are welcome!

# Fork the repo, then:
git checkout -b feature/your-feature-name
git commit -m "Add: your feature"
git push origin feature/your-feature-name
# Open a Pull Request πŸš€

πŸ“œ License

This project is licensed under the MIT License β€” feel free to use, modify, and distribute with attribution.


πŸ‘¨β€πŸ’» Developer

Ashish Goswami

⭐ If you found this project useful, consider giving it a star!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages