移除SpankBang年龄验证(Remove SpankBang Age Verification Modal Instantly)

Instantly removes the age verification modal on SpankBang.com with no flash

  1. // ==UserScript==
  2. // @name 移除SpankBang年龄验证(Remove SpankBang Age Verification Modal Instantly)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Instantly removes the age verification modal on SpankBang.com with no flash
  6. // @author You
  7. // @match *://*.spankbang.com/*
  8. // @grant GM_addStyle
  9. // @run-at document-start
  10. // @license MIT
  11.  
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // 在文档开始时注入CSS,确保模态窗口永不显示
  18. GM_addStyle(`
  19. #advanced-av {
  20. display: none !important;
  21. visibility: hidden !important;
  22. }
  23. body {
  24. position: static !important;
  25. height: auto !important;
  26. width: auto !important;
  27. overflow: auto !important;
  28. }
  29. `);
  30.  
  31. // 立即执行的函数,尝试在DOM构建前移除元素
  32. (function removeModalEarly() {
  33. const modal = document.getElementById('advanced-av');
  34. if (modal) {
  35. modal.remove();
  36. console.log('Modal removed early.');
  37. document.body.classList.remove('fixed', 'h-full', 'w-full');
  38. }
  39. })();
  40.  
  41. // MutationObserver监控动态添加的模态窗口
  42. const observer = new MutationObserver(function(mutations) {
  43. mutations.forEach(function(mutation) {
  44. const modal = document.getElementById('advanced-av');
  45. if (modal) {
  46. modal.remove();
  47. console.log('Modal removed via MutationObserver.');
  48. document.body.classList.remove('fixed', 'h-full', 'w-full');
  49. observer.disconnect();
  50. }
  51. });
  52. });
  53.  
  54. // 从文档开头开始观察
  55. observer.observe(document, {
  56. childList: true,
  57. subtree: true
  58. });
  59.  
  60. // DOM加载完成时再次检查
  61. document.addEventListener('DOMContentLoaded', function() {
  62. const modal = document.getElementById('advanced-av');
  63. if (modal) {
  64. modal.remove();
  65. console.log('Modal removed on DOMContentLoaded.');
  66. }
  67. document.body.classList.remove('fixed', 'h-full', 'w-full');
  68. });
  69.  
  70. // 页面完全加载时最后检查
  71. window.addEventListener('load', function() {
  72. const modal = document.getElementById('advanced-av');
  73. if (modal) {
  74. modal.remove();
  75. console.log('Modal removed on load.');
  76. }
  77. document.body.classList.remove('fixed', 'h-full', 'w-full');
  78. });
  79. })();

QingJ © 2025

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