您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
请求显示方法、地址、数据、超时时间、请求状态
当前为
// ==UserScript== // @name 请求拦截并显示返回数据 // @namespace // @version 20240221 // @description 请求显示方法、地址、数据、超时时间、请求状态 // @author ghost // @match http://*/* // @icon // @grant none // ==/UserScript== (function () { 'use strict'; var XHR = XMLHttpRequest.prototype; var open = XHR.open; var send = XHR.send; XHR.open = function (method, url) { this._method = method; this._url = url; return open.apply(this, arguments); }; XHR.send = function (postData) { this.addEventListener('load', function () { var obj = { method: this._method, requestUrl: this._url, status: this.status, timeout: this.timeout } if(this._method === 'POST'){ obj.postData = postData }else{ obj.getData = this._url.substr(this._url.indexOf('?')+1, this._url.length).replaceAll("&", " ") } console.table(obj); console.log('%creturn value', 'color:blue', JSON.parse(this.response)) }); return send.apply(this, arguments); }; })();