Skip to content

Instantly share code, notes, and snippets.

@iwat
Created February 13, 2021 05:17
Show Gist options
  • Save iwat/93629f67604dc3fd59f6b8bc23accd9b to your computer and use it in GitHub Desktop.
Save iwat/93629f67604dc3fd59f6b8bc23accd9b to your computer and use it in GitHub Desktop.
TradingView - Remove ads
// ==UserScript==
// @name TradingView - Remove ads
// @version 0.1
// @description Does what it says.
// @author Chaiwat
// @include https://www.tradingview.com/chart/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
console.log('Initialized TradingView Ads Remover');
const checkAd = setInterval(() => {
var articles = document.getElementsByTagName('article');
if (articles.length == 0) {
console.log('No ad(s)');
return;
}
for (var i = 0; i < articles.length; i++) {
articles[i].parentElement.parentElement.parentElement.remove();
}
console.log('Removed ad(s)');
}, 5000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment