您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically clicks the "Yes, I'm over 18" button on Reddit with retry logic
// ==UserScript== // @name Reddit Auto 18+ Confirmation // @namespace http://tampermonkey.net/ // @version 1.1.0 // @description Automatically clicks the "Yes, I'm over 18" button on Reddit with retry logic // @author LoopFix // @match https://www.reddit.com/* // @grant none // @license MIT // @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com // ==/UserScript== (function() { 'use strict'; const TARGET_SELECTOR = "body > shreddit-app > div.h-screen.absolute.flex.items-center.top-0.w-100 > div > div > div > confirm-over-18 > button"; const RETRY_INTERVAL_MS = 500; let retryLimit = 30; // Stop after 30 attempts (15 seconds) function tryClickOver18Button() { const button = document.querySelector(TARGET_SELECTOR); if (button) { console.log("✅ Found the over 18 button. Clicking it..."); button.click(); clearInterval(intervalId); } else { console.log("⏳ Over 18 button not found, retrying..."); retryLimit--; if (retryLimit <= 0) { console.warn("❌ Stopped retrying: Over 18 button not found after multiple attempts."); clearInterval(intervalId); } } } const intervalId = setInterval(tryClickOver18Button, RETRY_INTERVAL_MS); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址