您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
auto focuses search bar of dpm.lol
// ==UserScript== // @name dpm auto focus search bar // @namespace dpm_qol // @version 1.0 // @description auto focuses search bar of dpm.lol // @author Tzakazuki // @match https://dpm.lol/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @grant none // ==/UserScript== (function() { const el = document.querySelector(".rounded-lg.bg-blue-300\\/10"); if (!el) { console.log("Element NOT found"); return; } const rect = el.getBoundingClientRect(); const x = rect.left + rect.width / 2; const y = rect.top + rect.height / 2; const target = document.elementFromPoint(x, y); if (!target) { console.log("elementFromPoint failed"); return; } // Simulate a real user-like click ['pointerdown', 'mousedown', 'mouseup', 'click'].forEach(type => { const event = new MouseEvent(type, { clientX: x, clientY: y, bubbles: true, cancelable: true, view: window }); target.dispatchEvent(event); }); })();