// ==UserScript== // @name TMUE自动处理弹窗、点击确认和考试弹窗//切记子账号用此代码,主账号切勿使用 // @namespace http://tampermonkey.net/ // @version 0.6 // @description Automatically handle popups, click confirm, and other buttons on https://seller.kuajingmaihuo.com/ // @author Your Name // @license MIT // @match https://seller.kuajingmaihuo.com/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Helper function to click buttons with specific text function clickPopupButtons(buttonText) { let buttons = document.querySelectorAll('button.BTN_outerWrapperBtn_5-109-0'); buttons.forEach(function(button) { if (button.textContent.includes(buttonText)) { button.click(); } }); } // Helper function to close the new popup by clicking the SVG close icon function closeNewPopup() { let closeIcons = document.querySelectorAll('svg[data-testid="beast-core-icon-close"].ICN_outerWrapper_5-109-0'); closeIcons.forEach(function(closeIcon) { let clickableParent = closeIcon.closest('button, div'); if (clickableParent) { clickableParent.click(); } }); } // Helper function to click the confirmation span element function clickConfirmSpan() { let confirmSpans = document.querySelectorAll('button.BTN_outerWrapper_5-109-0 span'); confirmSpans.forEach(function(span) { if (span.textContent === '确认') { span.click(); } }); } // Set an interval to try and click the buttons and close the popups every 500 milliseconds (0.5 second) setInterval(function() { clickPopupButtons('下一条'); clickPopupButtons('我已阅读'); closeNewPopup(); clickConfirmSpan(); }, 500); })();