PTT Disp BBS AD blocking dectection blocker

Remove PTT Disp BBS AD blocking dectection dialog

  1. // ==UserScript==
  2. // @name PTT Disp BBS AD blocking dectection blocker
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Remove PTT Disp BBS AD blocking dectection dialog
  6. // @author regchiu
  7. // @match https://disp.cc/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12. let isRemovedDialog = false;
  13. document.addEventListener("readystatechange", () => {
  14. // Select the node that will be observed for mutations
  15. const targetNode = document.getElementById("body");
  16.  
  17. // Options for the observer (which mutations to observe)
  18. const config = { attributes: true, childList: true, subtree: true };
  19.  
  20. // Callback function to execute when mutations are observed
  21. const callback = () => {
  22. const element = document.querySelector(".fc-ab-root");
  23. if (element) {
  24. element.remove();
  25. isRemovedDialog = true;
  26. }
  27. };
  28.  
  29. // Create an observer instance linked to the callback function
  30. const observer = new MutationObserver(callback);
  31.  
  32. // Start observing the target node for configured mutations
  33. observer.observe(targetNode, config);
  34. if (isRemovedDialog) {
  35. observer.disconnect();
  36. }
  37. });

QingJ © 2025

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