简单的js hook

// ==UserScript==
// @name ethereum request
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://localhost:3000/
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==

(function() {
'use strict';
var old = window.ethereum.request
window.ethereum.request = function(method,params){
console.log("method:",method);
console.log("params:",params);
console.log("old:",old);
return old.call(this,method,params);
};
// Your code here...
})();

  

posted @ 2022-03-09 17:54  冷光清坠落  阅读(50)  评论(0编辑  收藏  举报