UViewPlus广告拦截器

UViewPlus广告拦截测试

// ==UserScript==
// @name         UViewPlus广告拦截器
// @namespace    http://tampermonkey.net/
// @version      0.4
// @author       yhxw
// @description  UViewPlus广告拦截测试
// @license      MIT
// @icon         ./uviewnoadicon.jpg
// @match        https://uiadmin.net/*
// @grant        none
// @noframes
// ==/UserScript==

(function () {
  'use strict';

  (function() {
    function init() {
      console.log("脚本已加载");
      const testDiv = document.createElement("div");
      testDiv.style.position = "fixed";
      testDiv.style.top = "10px";
      testDiv.style.right = "6px";
      testDiv.style.padding = "10px";
      testDiv.style.background = "red";
      testDiv.style.color = "white";
      testDiv.style.zIndex = "9999";
      testDiv.style.cursor = "pointer";
      testDiv.style.borderRadius = "8px";
      testDiv.textContent = "×遮挡广告";
      document.body.appendChild(testDiv);
      testDiv.addEventListener("click", function() {
        const style = document.createElement("style");
        style.type = "text/css";
        style.textContent = ".v-modal {top: 9999px!important;opacity: 0;pointer-events: none;}#pleasePrNotCrack {top: 9999px!important;opacity: 0;pointer-events: none;}";
        document.head.appendChild(style);
      });
    }
    if (document.readyState === "loading") {
      document.addEventListener("DOMContentLoaded", init);
    } else {
      init();
    }
  })();

})();