Fuck TradingView Ads off

Fuck all TradingView Ads off instanly

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Fuck TradingView Ads off
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @namespace   FuckTradingViewAdsoff
// @description Fuck all TradingView Ads off instanly
// @author      Ondrej Dadok
// @include     https://tradingview.com/*
// @include     https://www.tradingview.com/*
// @license     MIT
// @version     1.5
// ==/UserScript==

  const checkAd = setInterval(() => {

    const adBox = document.getElementById('tv-toasts');
    if (adBox) {
      adBox.querySelector("button").click();
      adBox.remove();
      console.log('ad removed.');
    } else {
      console.log('no ad present.');
    }


    const adBox2 = document.querySelector('div[class^="toast-wrapper-"]');
    if (adBox2) {
      adBox2.querySelector("button").click();
      adBox2.remove();
      console.log('ad removed.');
    } else {
      console.log('no ad present.');
    }


      const adunit = document.getElementById('adunit');
    if (adunit) {

      adunit.querySelector("button").click();
      adunit.remove();
      console.log('ad removed.');
    } else {
      console.log('no ad present.');
    }

  const adWrapper = document.querySelector("div[class^='toast-positioning-wrapper-']");
  if (adWrapper)
  {
      adWrapper.querySelector("button").click();
  }


  const adDialog = document.querySelector("div[data-dialog-name='gopro']");
  if (adDialog)
  {
      adDialog.querySelector("button").click();
  }


  }, 5000);