Created
February 13, 2021 05:17
-
-
Save iwat/93629f67604dc3fd59f6b8bc23accd9b to your computer and use it in GitHub Desktop.
TradingView - Remove ads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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