Skip to content

nilathj/tradingview-ad-remover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

TradingView pop up Ad Remover

A Tampermonkey userscript that automatically removes advertisements from TradingView charts and pages.

Features

  • Instantly removes ads as they are injected into the page
  • Multiple removal strategies:
    • MutationObserver for immediate removal of newly injected ads
    • Periodic checks every 5 seconds as a safety net
    • CSS rules to hide ad containers
  • Targets various ad types:
    • Google Ads iframes
    • Banner advertisements
    • Native ad units
    • Dynamic ad containers

Installation

  1. Install the Tampermonkey extension for your browser
  2. Click here to view the script
  3. Click the "Raw" button to view the source
  4. Tampermonkey should automatically detect the script and prompt you to install it
  5. Click "Install" to add the script to Tampermonkey

How it Works

The script uses three strategies to remove advertisements:

  1. MutationObserver: Watches the DOM for newly added elements and immediately removes any that match known ad patterns
  2. Periodic Checking: Runs every 5 seconds to catch any ads that might have slipped through
  3. CSS Rules: Hides common ad containers to prevent visual flicker

Ad Detection Methods

  • Matches iframe elements with:
    • IDs containing: google_ads_iframe, googleads
    • Source URLs containing: googlesyndication, doubleclick.net, ads
  • Matches elements with:
    • ID: adunit
    • Classes containing: tv-advertising, tv-advertisement, advertisement, banner-ads

Development

The script uses modern JavaScript features and DOM APIs:

  • MutationObserver for real-time DOM monitoring
  • querySelectorAll for efficient element selection
  • CSS attribute selectors for flexible matching
  • Promise-based timing for reliable execution

License

MIT License - Feel free to modify and share!

About

A Tampermonkey userscript that automatically removes advertisements from TradingView charts and pages.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors