您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
当前为
// ==UserScript== // @name 微信防撤销 // @namespace http://tampermonkey.net/ // @version 1.0.0.1003 // @description try to take over the world! // @author nkxyz // @match *://wx.qq.com/* // @match *://wx2.qq.com/* // @grant none // ==/UserScript== function modifyResponse(response) { var original_response, modified_response; if (this.readyState === 4) { if (this.requestURL && this.requestURL.indexOf("mmwebwx-bin/webwxsync") > 0 && this.requestMethod === "POST") { original_response = response.target.responseText; // try{ modified_response = JSON.parse(original_response); //console.log(modified_response) if(modified_response.AddMsgList && modified_response.AddMsgList.length > 0){ var msgType = modified_response.AddMsgList[0].MsgType; var info = modified_response.AddMsgList[0]; if ( msgType === 10002){ Object.defineProperty(this, "response", {writable: true}); modified_response.AddMsgList[0].MsgType = 1; modified_response = JSON.stringify(modified_response); this.response = modified_response; } } // }catch(e){ // this.responseText = original_response // } } } } function openBypass(original_function) { return function(method, url, async) { // 保存请求相关参数 this.requestMethod = method; this.requestURL = url; this.addEventListener("readystatechange", modifyResponse); return original_function.apply(this, arguments); }; } function sendBypass(original_function) { return function(data) { // 保存请求相关参数 this.requestData = data; return original_function.apply(this, arguments); }; } XMLHttpRequest.prototype.open = openBypass(XMLHttpRequest.prototype.open); //XMLHttpRequest.prototype.send = sendBypass(XMLHttpRequest.prototype.send);