您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Clicks the "Skip" button every time it appears
当前为
// ==UserScript== // @name Review Skip // @namespace https://greasyfork.org/en/users/1291009 // @version 2.2 Beta // @description Clicks the "Skip" button every time it appears // @author BadOrBest // @license MIT // @icon https://www.google.com/s2/favicons?sz=64&domain=acellus.com // @match https://admin192c.acellus.com/student/* // @grant GM_setValue // @grant GM_getValue // @grant GM_info // @grant GM_listValues // @grant GM_deleteValue // @grant GM_disable // @run-at document-end // ==/UserScript== (function() { 'use strict'; let isEnabled = false; // Flag to track script enable/disable let debounceTimer; // Timer for debouncing continuous clicking let reloadOnDisable = GM_getValue('reloadOnDisable', false); // Get the reload option state // Function to click the "Skip" button function clickSkipButton(skipElement) { try { if (skipElement) { skipElement.click(); } } catch (error) { console.error('Error clicking skip button:', error); } } // Function to handle mutations function handleMutations(mutationsList, observer) { for (const mutation of mutationsList) { if (mutation.type === 'childList') { const newSkipElements = Array.from(mutation.addedNodes).filter(node => node.textContent.trim() === 'Skip'); if (newSkipElements.length > 0) { if (isEnabled) { newSkipElements.forEach(newSkipElement => clickSkipButton(newSkipElement)); } } } } } // Function to continuously click the "Skip" button with debouncing function clickSkipButtonContinuously() { clearTimeout(debounceTimer); debounceTimer = setTimeout(() => { const skipSpans = Array.from(document.querySelectorAll('span')).filter(span => span.textContent.trim() === 'Skip'); if (isEnabled) { skipSpans.forEach(span => clickSkipButton(span)); } }, 500); } // Create a MutationObserver to watch for changes in the DOM const observer = new MutationObserver(handleMutations); observer.observe(document.documentElement, { childList: true, subtree: true }); // Function to toggle script enable/disable function toggleScript() { isEnabled = !isEnabled; if (isEnabled) { toggleButton.textContent = 'Review Skip ON'; toggleButton.classList.remove('script-off'); toggleButton.classList.add('script-on'); toggleButton.style.backgroundColor = '#28a745'; } else { toggleButton.textContent = 'Review Skip OFF'; toggleButton.classList.remove('script-on'); toggleButton.classList.add('script-off'); toggleButton.style.backgroundColor = '#dc3545'; if (reloadOnDisable) { location.reload(); // Reload the page if the option is ON } } adjustCollapsibleButtonPosition(); } // Create the toggle button const toggleButton = document.createElement('button'); toggleButton.textContent = 'Review Skip OFF'; toggleButton.classList.add('toggle-button', 'script-off'); toggleButton.addEventListener('click', toggleScript); // Style the toggle button (same as before) // ... document.body.appendChild(toggleButton); // Create the collapsible button const collapsibleButton = document.createElement('button'); collapsibleButton.innerHTML = '▼'; collapsibleButton.classList.add('collapsible-button'); collapsibleButton.addEventListener('click', function() { toggleButton.style.display = toggleButton.style.display === 'none' ? 'block' : 'none'; adjustCollapsibleButtonPosition(); }); document.body.appendChild(collapsibleButton); setInterval(clickSkipButtonContinuously, 1000); function adjustCollapsibleButtonPosition() { if (toggleButton.style.display !== 'none') { collapsibleButton.innerHTML = '▼'; collapsibleButton.style.backgroundColor = 'transparent'; const rect = toggleButton.getBoundingClientRect(); collapsibleButton.style.top = rect.top + 'px'; collapsibleButton.style.left = rect.left + 'px'; } else { collapsibleButton.innerHTML = '▲'; collapsibleButton.style.backgroundColor = 'black'; collapsibleButton.style.top = 'auto'; collapsibleButton.style.bottom = '20px'; collapsibleButton.style.left = '10px'; } } adjustCollapsibleButtonPosition(); // Add Tampermonkey menu commands GM.registerMenuCommand("Toggle Reload on Disable (Current: " + (reloadOnDisable ? "ON" : "OFF") + ")", function() { reloadOnDisable = !reloadOnDisable; GM_setValue('reloadOnDisable', reloadOnDisable); alert("Reload on Disable is now " + (reloadOnDisable ? "ON" : "OFF")); }); })();