您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Auto-select radio/checkbox inputs and click next button
// ==UserScript== // @name Решатель Тестов RSV by @AndrewBPC // @namespace http://tampermonkey.net/ // @version 1.1 // @description Auto-select radio/checkbox inputs and click next button // @author You // @match https://testing.rsv.ru/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const toObserve = '.SingleQuestion__RadioGroup, .SingleQuestion__Content_Block, .GridQuestion__Row, .RadioGroup__Radio_CustomRow, .DispositionQuestion__RadioGroup'; function selectInputsAndClickNext() { // Find all question groups let questionGroups = document.querySelectorAll(toObserve); questionGroups.forEach(group => { let input = group.querySelector('input[id^="input-"][type="radio"], input[id^="input-"][type="checkbox"]'); if (input && !input.checked) { input.checked = true; input.dispatchEvent(new Event('change', { bubbles: true })); console.log("Input selected:", input.id); } }); // Find and click the "Далее" button let nextButton = [...document.querySelectorAll('button')] .find(btn => btn.textContent.trim() === 'Далее'); if (nextButton) { nextButton.click(); console.log("Clicked 'Далее' button"); } } function checkPageLoad() { let observer = new MutationObserver(() => { if (document.querySelector(toObserve)) { selectInputsAndClickNext(); } }); observer.observe(document.body, { childList: true, subtree: true }); } window.addEventListener('load', checkPageLoad); setTimeout(selectInputsAndClickNext, 1000); })();