Fuck TradingView Ads off

Fuck all TradingView Ads off instanly

当前为 2021-12-15 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Fuck TradingView Ads off
// @require     http://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.4
// ==/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.getElementById('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);