Skip to content

dev-alihasan/Javascrit-script-for-block-YT-ad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Ad Blocker Script

This repository contains a JavaScript code that serves as an ad blocker for web pages. The code is designed to run in a web browser and remove both video ads and banner ads from a webpage.

Usage

To use this ad blocker script, follow these steps:

  1. Open your web browser.

  2. Go to the web page where you want to block ads.

  3. Open the browser's developer console. You can typically do this by right-clicking on the web page, selecting "Inspect" or "Inspect Element," and then navigating to the "Console" tab.

  4. Copy and paste the provided JavaScript code into the console.

  5. Press Enter to run the code.

The script will automatically remove video ads with the class name video-ads and banner ads with the class name ytp-ad-overlay-container. Make sure that these class names are consistent with the ads on the webpage you want to block. If the web page uses different class names for its ads, you may need to modify the script accordingly.

note

If u need to block ads with different class names, u can customize the script by replacing the class names in the querySelectorAll calls with the appropriate class names.

disclaimer

Please be aware that ad blocking on websites can affect their revenue, and some websites may have anti-ad-blocking measures in place. The use of ad blockers should be in compliance with website terms of service and local regulations.

Author