您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically deletes Facebook activity entries with GUI, error handling, and auto-scroll. Starts paused. Skips next item if current fails twice.
当前为
// ==UserScript== // @name Facebook Activity Auto Deleter (2025) // @namespace https://gf.qytechs.cn/en/users/1454546-shawnfrost13 // @version 4.0 // @description Automatically deletes Facebook activity entries with GUI, error handling, and auto-scroll. Starts paused. Skips next item if current fails twice. // @author shawnfrost13 // @license MIT // @match https://www.facebook.com/*/allactivity* // @grant none // @run-at document-end // ==/UserScript== (function() { 'use strict'; console.log("🔥 FB Auto Deleter 2025 v3.91 started"); let deletionCount = 0; let paused = true; let failureCount = 0; let skipNext = false; function getRandomDelay(min = 1100, max = 2100) { return Math.floor(Math.random() * (max - min + 1)) + min; } function logStatus(text) { let el = document.getElementById('fb-auto-delete-status'); if (!el) { el = document.createElement('div'); el.id = 'fb-auto-delete-status'; el.style.position = 'fixed'; el.style.bottom = '50px'; el.style.right = '10px'; el.style.background = '#111'; el.style.color = 'lime'; el.style.padding = '10px'; el.style.borderRadius = '10px'; el.style.fontFamily = 'monospace'; el.style.zIndex = '9999'; document.body.appendChild(el); } el.textContent = `🧹 ${text}`; } function createToggleButton() { const toggle = document.createElement('button'); toggle.textContent = '▶️ Start'; toggle.style.position = 'fixed'; toggle.style.bottom = '90px'; toggle.style.right = '10px'; toggle.style.zIndex = '9999'; toggle.style.padding = '8px 12px'; toggle.style.borderRadius = '10px'; toggle.style.border = 'none'; toggle.style.background = '#333'; toggle.style.color = 'white'; toggle.style.fontSize = '14px'; toggle.style.cursor = 'pointer'; toggle.style.fontFamily = 'monospace'; toggle.addEventListener('click', () => { paused = !paused; toggle.textContent = paused ? '▶️ Start' : '⏸️ Pause'; if (!paused) { logStatus('Resumed'); deleteNext(); } else { logStatus('Paused'); } }); document.body.appendChild(toggle); } function findMenuButtons() { return Array.from(document.querySelectorAll('[role="button"]')).filter(btn => { const label = btn.getAttribute('aria-label') || ''; return ( btn.offsetParent !== null && (label.toLowerCase().includes("activity options") || label.toLowerCase().includes("action options")) ); }); } function autoConfirmPopups() { const dialogs = Array.from(document.querySelectorAll('[role="dialog"], [role="alertdialog"]')); dialogs.forEach(dialog => { const deleteBtn = Array.from(dialog.querySelectorAll('div[role="button"], button')) .find(btn => btn.offsetParent !== null && btn.innerText.trim().toLowerCase() === "delete" ); if (deleteBtn) { console.log("✅ Auto-confirming DELETE dialog"); deleteBtn.click(); logStatus("Auto-confirmed delete popup"); } }); // Close "Something went wrong" popup if present const errorPopup = Array.from(document.querySelectorAll('div')) .find(div => div.textContent.includes("Something went wrong. Please try again.")); if (errorPopup) { const closeBtn = errorPopup.querySelector('[aria-label="Close"]'); if (closeBtn) closeBtn.click(); } } function autoScrollAndRetry() { console.log("🔄 Scrolling to load more activity..."); logStatus("Scrolling to load more items..."); window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' }); setTimeout(() => { deleteNext(); }, 2500); } function deleteNext() { if (paused) return; autoConfirmPopups(); const buttons = findMenuButtons(); if (buttons.length === 0) { logStatus('No deletable buttons found. Trying to scroll...'); autoScrollAndRetry(); return; } if (skipNext) { logStatus("⏩ Skipping next entry after failed one..."); console.log("⏭️ Skipping one entry due to previous repeated failure"); skipNext = false; buttons.shift(); // remove the first one } const btn = buttons[0]; if (!btn) { logStatus("No valid button to interact with."); setTimeout(deleteNext, getRandomDelay()); return; } btn.scrollIntoView({ behavior: 'smooth', block: 'center' }); btn.click(); logStatus(`Opened menu for item #${deletionCount + 1}`); console.log(`📂 Opened menu for item #${deletionCount + 1}`); setTimeout(() => { const menuItems = Array.from(document.querySelectorAll('[role="menuitem"]')); const deleteOption = menuItems.find(el => el.innerText.includes("Move to Recycle bin") || el.innerText.includes("Delete") || el.innerText.includes("Remove") || el.innerText.includes("Unlike") || el.innerText.includes("Remove reaction") || el.innerText.includes("Remove tag") ); if (deleteOption) { deleteOption.click(); setTimeout(() => { const failedPopup = Array.from(document.querySelectorAll('div')) .find(div => div.textContent.includes("Something went wrong. Please try again.")); if (failedPopup) { failureCount++; logStatus(`❌ Failed to delete (attempt ${failureCount})`); console.log(`🚫 Deletion failed. Attempt #${failureCount}`); if (failureCount >= 2) { skipNext = true; failureCount = 0; } const closeBtn = failedPopup.querySelector('[aria-label="Close"]'); if (closeBtn) closeBtn.click(); setTimeout(deleteNext, getRandomDelay()); } else { deletionCount++; failureCount = 0; logStatus(`✅ Deleted item #${deletionCount}`); console.log(`🗑️ Deleted item #${deletionCount}`); setTimeout(deleteNext, getRandomDelay()); } }, 1500); } else { logStatus(`⚠️ No delete option found. Skipping.`); console.log("⚠️ No delete/remove option found. Skipping..."); setTimeout(deleteNext, getRandomDelay()); } }, 1500); } createToggleButton(); logStatus("Script loaded and paused. Click ▶️ Start to begin."); setInterval(autoConfirmPopups, 1000); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址