// ==UserScript== // @name AKG 批量采集工具(带action=grab + resource_id 1-6自选) // @namespace http://tampermonkey.net/ // @version 3.0 // @description 自动捕获环境 + 带action=grab + 自选资源ID + 极速批量请求 // @match https://718zf.xyz/akg_miner.php // @grant GM_xmlhttpRequest // @run-at document-start // ==/UserScript== (function() { 'use strict'; // 全局保存请求环境 let SAVED = { url: '', method: '', headers: {}, hasData: false }; let isListening = true; // ============================ // 劫持 XHR 捕获真实请求 // ============================ const origOpen = XMLHttpRequest.prototype.open; const origSend = XMLHttpRequest.prototype.send; XMLHttpRequest.prototype.open = function(method, url) { if (url.includes('akg_api.php') && isListening && !SAVED.hasData) { this._url = url; this._method = method; this._headers = {}; const self = this; this.setRequestHeader = function(k, v) { self._headers[k] = v; XMLHttpRequest.prototype.setRequestHeader.call(this, k, v); }; } origOpen.apply(this, arguments); }; XMLHttpRequest.prototype.send = function(body) { if (this._url?.includes('akg_api.php') && isListening && !SAVED.hasData) { // 保存环境 SAVED.url = this._url; SAVED.method = this._method; SAVED.headers = this._headers; SAVED.hasData = true; setTimeout(createPanel, 300); } origSend.apply(this, arguments); }; // ============================ // 控制面板 // ============================ function createPanel() { if (document.getElementById('akgPanel')) return; const p = document.createElement('div'); p.id = 'akgPanel'; p.style.cssText = ` position:fixed;top:30px;right:30px;width:300px; background:#121212;color:#fff;padding:16px;border-radius:12px; z-index:999999;font-size:14px;box-shadow:0 0 12px #0005 `; p.innerHTML = `