-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathhook_JSON.js
30 lines (27 loc) · 1.03 KB
/
hook_JSON.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// ==UserScript==
// @name hook_JSON
// @namespace https://github.com/0xsdeo/Hook_JS
// @version 2024-10-29
// @description 重写parse和stringify方法,以此来获取调用这个方法所传入的内容以及堆栈信息。
// @author 0xsdeo
// @match http://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
(function() {
'use strict';
let json_p = JSON.parse;
JSON.parse = function(str){
console.log(str);
console.log(new Error().stack);
console.log("-----------------------------------------------------------------------------------------------------")
return json_p(str);
}
let json_s = JSON.stringify;
JSON.stringify = function(obj){
console.log(obj);
console.log(new Error().stack);
console.log("-----------------------------------------------------------------------------------------------------")
return json_s(obj);
}
})();