tutu / AD Blocker

// ==UserScript==
// @namespace https://openuserjs.org/users/tutu
// @exclude *

// ==UserLibrary==
// @name AD Blocker
// @description just ad boocker
// @copyright 2021, tutu (https://openuserjs.org/users/tutu)
// @license MIT
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHMAAABRCAYAAADhJ5nbAAAK00lEQVR4Ae1dXWxcRxXuA1J55IXHSkChrUQFAqkvBdGi8oJUUrUUCSREqSIECJAQKg+tBBKlEAKkAomqCCUl/ASq8t+k5Tf9UdPUseM4zqaOnWSx8Tobr9dZ79q76921vQd91x3r+Ozs/T2zu3bvka7vvbP3zpwz35yZc87MXF83lDtE6bHz64CI6LoUyJ0PJDBMwdxFvVIKZgrm7uiWdtvwkmpmqpmpZg6iVqeamWpmqpmpZu4iLUjBTMF0GmlLx8xd1MB2FJin80ectuxoXedTA8TLpg0z8GBOFv9Bpfo0Ndeq4JVa7ToV61m6vPhiTyvzdP63NFn8F80tj9NKs0Ab7XVqrFVpoXaJsqVXaOzqH3rKj63hDTSYc5Wz1G63PRBtf+ZXXndWgWNXn/EaTKF6gerNJVvxHWmNtRUq1C5StvQy4X1bhbtMA0MDN2uC7rTcuNJRWbYEbUCH5w57mmcrK2oaB/fU3GHn4IK/gQITQK62lkPXW6u9qlZJp3K/pKXGXOiyozyIxuka0IEDs9Kcj1JH3rPQJo3uC2OzS3INKHgfGM3MVUYj12WtWVIBslCdjFx2nBfKjTxpNT7ZgAcGzPH5P3kWYtQKmiz+OzGYMLR6SZWmG0AHBky02KiUq4wlBhKWZz/IBaCQo+/d7GTxn5HrEy6A7Gbi3EcxtiIzGfACANU0igYCzJVGMUDszp81ggaZhaOdGfc4Zbr8mkqjREMG9VUzEVWJS0nHy1w5usHlxyvcpGLtMiHQAMsVUaIggi8ap0exvYOy+gpmHK00FQRXwiZU2DRUvAattipe1Ad+Ki8bIUCE/zY21nyLQciSvxf3GoX0DcyJ4jFfIYN+hIMfV3C8V1r9X1ARvr9DEze7Sf+g+/j8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Z2dgYmvaHCLU3s1Ha8Q7F42pGVc8GAHtCpM92gHsu199ZLz6+raGZjcOEEh2CzkSggsWzQWqNYiLIy/nDCO+vGPD23IrhWNGUaQ33uavzkDU35FRLokmkIgL65J+CSMRv68q930De3f6LP5ywiWaMWMw8riDEze9SH6oTWWdRMMszPGetSK3Mith7YtBIjk8OEEFYolpQiqd+PVVbozMLmzHMYl0RCQL5SGj5s0T9t3F2AxwyrFjIrNL4ZL1W2CICk/Qe87AxPOsaFejRuofDMRDm1BV28qIO5UU9hvBW1+e8G9xWrksZ2dgclnH2yzHjZmNNLQvZkwHwwSbCFEw0LwIU7+PFZrGqc5Y+YHmqoVrIjDH3/HGZhGM7WC1ZzpoGs4+dx4gZBhVs13yxc7zgwhbIiexpXP3I2HMOnOwDRx2aVGLpZGhGHe7xmE/RBOXNtoesBiY5Df836/4bs/xvVx6S/78RDmN2dgwgiAbyZjqWGYGsRnsDcEAXgtt8eFjM7AdMFsmqf/P9RLwUz/fZR/C0k1qD/1k2pmqpn9aXmpxvvXe6qZqWb6t5BUg/pTP6lmpprZn5aXarx/vaeamWqmfwtJNag/9ZNq5i7TzP8D2fTfuXDwtcgAAAAASUVORK5CYII=
// @version 1.0
// @note 1.0 去掉CSDN广告推广

// ==/UserScript==

// ==/UserLibrary==

// ==OpenUserJs
// @author tutu
// ==/OpenUserJs==

// 去除推广广告  配置域名??
const feed = setInterval(function () {
    // 取出iframe广告
  const iframes = document.querySelectorAll('iframe');
  const adDomains = [
    'https://pos.baidu.com',
    'https://kunpeng-sc.csdnimg.cn'
  ]
  iframes.forEach(function (iframe) {
    const src = iframe.getAttribute('src')

    if (adDomains.some(domain => src.startsWith(domain))) {
      iframe.remove()
      console.log(`已移除推广链接:${src} `)
    }
  })
}, 2e3)

window.addEventListener('unload', function () {
  clearInterval(feed)
})