Shellshock.io Ad Blocker

Blocks ads on Shellshock.io

目前为 2024-09-03 提交的版本。查看 最新版本

// ==UserScript==
// @name         Shellshock.io Ad Blocker
// @namespace    https://shellshock.io
// @description  Blocks ads on Shellshock.io
// @version      1.2
// @match        https://shellshock.io/*
// @license MIT
// ==/UserScript==

(function() {
  'use strict';

  // Function to remove the ad blocker warning element
  function removeAdBlockerWarning() {
    var adBlockerWarning = document.getElementById('adBlockerVideo');
    if (adBlockerWarning) {
      adBlockerWarning.parentNode.removeChild(adBlockerWarning);
    }
  }

  // Function to prevent ads from being loaded
  function blockAds() {
    var aiptag = window.aiptag;
    if (aiptag) {
      aiptag.cmd = [];
      aiptag.cmd.display = [];
      aiptag.cmd.player = [];
    }
  }

  // Observe the document for changes to detect when the ad blocker warning element is created
  var observer = new MutationObserver(function(mutations) {
    mutations.forEach(function(mutation) {
      if (mutation.addedNodes && mutation.addedNodes.length > 0) {
        for (var i = 0; i < mutation.addedNodes.length; i++) {
          var node = mutation.addedNodes[i];
          if (node.id === 'adBlockerVideo') {
            removeAdBlockerWarning();
          }
        }
      }
    });
  });

  // Configure the observer to observe the document for changes
  observer.observe(document, {
    childList: true,
    subtree: true
  });

  // Block ads immediately
  blockAds();

  // Block ads whenever the aiptag object is updated
  setInterval(blockAds, 1000);
})();

QingJ © 2025

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