Skip to content

UjjwalSaini07/Shield-AdBlocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shield-AdBlocker

Shield AdBlocker is a Chrome extension designed to block unwanted ads and trackers using the declarativeNetRequest API in Chrome's Manifest V3. By applying predefined rules to known ad-serving domains, it ensures a faster, cleaner, and more secure browsing experience, free from intrusive ads and tracking technologies.

Github License Info Generic badge GitHub stars Github Release

Features

  • 🚫 Blocks ads from popular ad-serving domains such as:
    • doubleclick.net, googleadservices.com, googlesyndication.com, youtubeads.googleapis.com, facebook.com/ads/, twitter.com/ads, amazon-adsystem.com, bing.com/ad.
  • ⚡ Utilizes Chrome's efficient declarativeNetRequest API for improved performance and security.
  • 🔧 Easy to configure and extend by modifying the rules.json file.
  • 🔒 Enhances privacy by preventing tracking scripts from loading.
  • 🚀 Provides a faster and smoother browsing experience by reducing page load times.

Project Structure

📂 Shield-AdBlocker-rootDir
├── 📂 docs
│   └── 📄 Architecture.md
├── 📂 icons
│   ├── 🖼️ icon24.png
│   ├── 🖼️ icon48.png
│   ├── 🖼️ icon128.png
│   └── 🖼️ MainLogo.png
├── 📄 CHANGELOG.md
├── 📄 LICENSE
├── 📄 manifest.json
├── 📄 messages.json
├── 📄 README.md
├── 📄 rules.json

How It Works

  1. 📜 The manifest.json file configures the extension by enabling the declarativeNetRequest API, which is responsible for blocking ads. It also points to the rules.json file, which contains the rules for ad-blocking.
  2. 📝 The rules.json file holds a list of ad-blocking rules, each defining a URL pattern (e.g., doubleclick.net) that should be blocked to prevent ads and trackers from loading.
  3. 🚫 Once the extension is loaded in Chrome, it automatically applies the rules from rules.json, blocking any network requests that match the specified patterns, ensuring a cleaner and faster browsing experience.
  4. ⚡ The declarativeNetRequest API processes the rules efficiently in the background, minimizing performance overhead while providing a seamless experience for users.
  5. 🔧 The extension is highly configurable, allowing you to easily add, remove, or modify rules in the rules.json file, making it customizable to fit your ad-blocking needs.

Installation

  • First Read this License & their terms then proceed.
  • Star ⭐ the Repository
  • Clone or download this repository to your local machine.
    git clone https://github.com/UjjwalSaini07/Shield-AdBlocker.git
  • Just Download from Here Source Asset Files- Link
  • 🌐 Open Chrome and go to chrome://extensions/ in the address bar.
  • Enable "Developer mode" by toggling the switch in the top-right corner of the Extensions page.
  • Click on "Load unpacked" and select the project folder where the extension files are stored.
  • 🚀 The extension will now be loaded into Chrome, and ads matching the rules in rules.json will be automatically blocked.
  • Test the extension by visiting websites with known ads or trackers to see it in action.
  • Configure the extension by modifying the rules.json file for custom ad-blocking preferences.
  • Update and maintain the extension by loading new versions with any changes you make to the project folder.

Customization

To add or modify blocking rules:

  1. Open the rules.json file in your preferred text editor.
  2. Add a new rule object, specifying the id, priority, action, and condition for the rule.
  3. Save the changes to the file.
  4. Reload the extension in Chrome by going to chrome://extensions/ and clicking the "Reload" button on your extension card.
  5. Test your changes by visiting websites that should be affected by the new rules to ensure proper functionality.
  6. Modify existing rules by adjusting their priority, condition, or action as needed to refine the blocking process.
  7. You can also remove rules by deleting specific rule objects from rules.json to stop blocking particular domains.
  8. For advanced customization, consider combining multiple conditions or actions, such as blocking multiple domains or applying different actions (e.g., redirecting requests).
  9. Ensure that the id of each rule is unique to avoid conflicts and maintain smooth rule processing.
  10. Once you're satisfied with the changes, you can share your custom rules by exporting the rules.json file, allowing others to benefit from your configuration.

Example Rule Set

{
    "id": 1,
    "priority": 1,
    "action": { "type": "block" },
    "condition": { "urlFilter": "*://*example-ad-domain.com/*" }
}

Contact 📞

Feel free to reach out if you have any questions or suggestions!

Feedback and Contributions 💌

Feedback and contributions are always welcome! Feel free to open an Issue.

About

A Chrome extension that blocks unwanted ads and trackers using the declarativeNetRequest API, providing a faster, cleaner, and more secure browsing experience with predefined rules.

Topics

Resources

License

Stars

Watchers

Forks

Contributors