您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
get the token from the request in this page
// ==UserScript== // @name Show me your token // @namespace http://tampermonkey.net/ // @version 0.1 // @description get the token from the request in this page // @author ddhjy // @match https://bytest-admin.bytedance.net/edge/publish/linux/cluster/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; var open = XMLHttpRequest.prototype.open; var headers = {}; XMLHttpRequest.prototype.open = function() { console.log("XMLHttpRequest.open(method: " + arguments[0] + ", url: " + arguments[1] + ")"); open.apply(this, arguments); }; var setRequestHeader = XMLHttpRequest.prototype.setRequestHeader; XMLHttpRequest.prototype.setRequestHeader = function(header, value) { headers[header] = value; setRequestHeader.apply(this, arguments); }; var added = false; var send = XMLHttpRequest.prototype.send; XMLHttpRequest.prototype.send = function() { console.log("XMLHttpRequest.send(data: " + arguments[0] + ")"); console.log("headers: ", headers); if(headers["X-Jwt-Token"] && !added) { added = true; var div = document.createElement("div"); div.innerHTML = headers["X-Jwt-Token"]; document.body.insertBefore(div, document.body.firstChild); } headers = {}; send.apply(this, arguments); }; })();