您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
拦截并处理HTTP请求
// ==UserScript== // @name 观测云取消查询限制 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 拦截并处理HTTP请求 // @author czy // @match *://cn4-console.guance.com/* // @license MIT // @run-at document-start // @require https://unpkg.com/ajax-hook/dist/ajaxhook.min.js // @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) { console.log('xhr request:', this._method, this._url, postData); if (this._url.includes("api/v1/df/asynchronous/query_data") && this._method.includes("POST") ) { let newPostData = postData.replace(/100/g, "1000"); console.log('new request:', this._method, this._url, newPostData); return send.call(this, postData, arguments); } else { return send.apply(this, arguments); } }; })();