您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
The script will automatically click on the start button and answer the questions for the driving mock test
// ==UserScript== // @name Shortcut for Driving Mock Test // @namespace http://tampermonkey.net/ // @version 0.1 // @description The script will automatically click on the start button and answer the questions for the driving mock test // @author You // @match http://theory-tester.com/questions/* // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; //添加键盘事件 document.body.addEventListener('keydown',event => { var options = document.querySelectorAll("li.options-single label"); // Query all the <label> elements under <li> elements with class "options-single" var next = document.querySelector("span.icon-right-open") var save = document.querySelector("span.icon-bookmark") switch (event.key){ case '1': // options[0].click() break; case '2': // options[1].click(); break; case '3': // options[2].click(); break; case '4': // options[3].click(); break; case 'f': // next.click(); break; case 's': // next one save.click(); break; } } ) })();