Block Twitch Ads

Blocks Twitch.tv ads

目前为 2023-02-16 提交的版本。查看 最新版本

// ==UserScript==
// @name        Block Twitch Ads
// @namespace   http://www.example.com/
// @match     https://www.twitch.tv/*
// @version     1.2
// @license MIT
// @description  Blocks Twitch.tv ads
// @grant       none
// ==/UserScript==

(function() {
  'use strict';

  const observer = new MutationObserver((mutations) => {
    mutations.forEach((mutation) => {
      mutation.addedNodes.forEach((node) => {
        if (node.nodeName === "DIV") {
          if (node.className && node.className.includes("ad-slot")) {
            node.remove();
          }
        }
      });
    });
  });

  observer.observe(document.body, { childList: true, subtree: true });

  const adSlots = document.querySelectorAll(".ad-slot");

  adSlots.forEach((adSlot) => {
    adSlot.remove();
  });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址