您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically submits any dynamic question input by pressing ENTER
// ==UserScript== // @name HackTheBox Academy - Press Enter To Submit // @namespace https://gf.qytechs.cn/en/users/1488917-l0wk3y-iaan // @compatible Tampermonkey // @version 1.0 // @description Automatically submits any dynamic question input by pressing ENTER // @author L0WK3Y @infophreak // @match https://www.hackthebox.com/home* // @match https://academy.hackthebox.com/* // @match https://www.hackthebox.eu/home* // @icon https://www.hackthebox.com/images/favicon.png // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; function setupInputListeners() { const inputs = document.querySelectorAll('input[id^="answer"]'); inputs.forEach(input => { if (input.dataset.enterListenerAttached) return; // prevent duplicates input.dataset.enterListenerAttached = true; input.addEventListener('keydown', function (e) { if (e.key === 'Enter') { e.preventDefault(); const idSuffix = this.id.replace('answer', ''); const submitBtn = document.getElementById(`btnAnswer${idSuffix}`); if (submitBtn) submitBtn.click(); } }); }); } // Re-run listener setup as new elements may be loaded dynamically const observer = new MutationObserver(() => setupInputListeners()); observer.observe(document.body, { childList: true, subtree: true }); // Initial setup setupInputListeners(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址