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.
- 🚫 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.
📂 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
- 📜 The
manifest.jsonfile configures the extension by enabling thedeclarativeNetRequestAPI, which is responsible for blocking ads. It also points to therules.jsonfile, which contains the rules for ad-blocking. - 📝 The
rules.jsonfile 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. - 🚫 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. - ⚡ The
declarativeNetRequestAPI processes the rules efficiently in the background, minimizing performance overhead while providing a seamless experience for users. - 🔧 The extension is highly configurable, allowing you to easily add, remove, or modify rules in the
rules.jsonfile, making it customizable to fit your ad-blocking needs.
- 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.jsonwill 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.jsonfile for custom ad-blocking preferences. - Update and maintain the extension by loading new versions with any changes you make to the project folder.
To add or modify blocking rules:
- Open the
rules.jsonfile in your preferred text editor. - Add a new rule object, specifying the
id,priority,action, andconditionfor the rule. - Save the changes to the file.
- Reload the extension in Chrome by going to
chrome://extensions/and clicking the "Reload" button on your extension card. - Test your changes by visiting websites that should be affected by the new rules to ensure proper functionality.
- Modify existing rules by adjusting their
priority,condition, oractionas needed to refine the blocking process. - You can also remove rules by deleting specific rule objects from
rules.jsonto stop blocking particular domains. - For advanced customization, consider combining multiple conditions or actions, such as blocking multiple domains or applying different actions (e.g., redirecting requests).
- Ensure that the
idof each rule is unique to avoid conflicts and maintain smooth rule processing. - Once you're satisfied with the changes, you can share your custom rules by exporting the
rules.jsonfile, allowing others to benefit from your configuration.
{
"id": 1,
"priority": 1,
"action": { "type": "block" },
"condition": { "urlFilter": "*://*example-ad-domain.com/*" }
}Feel free to reach out if you have any questions or suggestions!
- Raise an issue for the same Issue
- Github: @Ujjwal Saini
Feedback and contributions are always welcome! Feel free to open an Issue.