// ==UserScript== // @name xhr_setRequestHeader // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://ppzh.jd.com/octopusbrandweb/brand/view/search/rankLocationNew.html // @grant none // @run-at document-start // ==/UserScript== (function() { 'use strict'; let org = window.XMLHttpRequest.prototype.setRequestHeader; window.XMLHttpRequest.prototype.setRequestHeader = function(key,value){ let keyToLocaleLowerCase = key.toLocaleLowerCase(); console.log(keyToLocaleLowerCase, value) if(keyToLocaleLowerCase.indexOf('sign') !== -1){ debugger; } return org.apply(this,arguments); } })();
标签:XMLHttpRequest,RequestHeader,setRequestHeader,js,hook,org,keyToLocaleLowerCase From: https://www.cnblogs.com/angdh/p/17465951.html