您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically confirm tweet deletion on X.com
// ==UserScript== // @name Auto Delete Tweet Confirmation // @namespace http://tampermonkey.net/ // @version 0.2 // @description Automatically confirm tweet deletion on X.com // @author wez + chatgpt // @match https://x.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to click the confirmation button function clickConfirmButton() { const confirmButton = document.querySelector('[data-testid="confirmationSheetConfirm"]'); if (confirmButton) { console.log('Confirmation button found, clicking...'); confirmButton.click(); // Click to confirm deletion } else { console.log('Confirmation button not found.'); } } // Create a MutationObserver to detect when the confirmation dialog appears const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { // Check if the confirmation dialog is in the DOM if (mutation.addedNodes.length) { mutation.addedNodes.forEach((node) => { if (node.nodeType === Node.ELEMENT_NODE && node.querySelector('[data-testid="confirmationSheetDialog"]')) { console.log('Confirmation dialog detected, attempting to click confirm button...'); clickConfirmButton(); // Attempt to click the confirm button } }); } }); }); // Start observing the body for changes observer.observe(document.body, { childList: true, subtree: true }); console.log('Auto Delete Tweet Confirmation script loaded'); })();