🏠 Home 

FunctionHooker.js

Hook most functions on runtime via the function name

สคริปต์นี้ไม่ควรถูกติดตั้งโดยตรง มันเป็นคลังสำหรับสคริปต์อื่น ๆ เพื่อบรรจุด้วยคำสั่งเมทา // @require https://update.greasyfork.org/scripts/469993/1214452/FunctionHookerjs.js

ผู้เขียน
TetteDev
เวอร์ชัน
0.1
สร้างเมื่อ
02-07-2023
อัปเดตเมื่อ
02-07-2023
Size
3.6 กิโลไบต์
สัญญาอนุญาต
ไม่มี

Example Usage

const hooker = new FunctionHooker();
hooker.hook('window.addEventListener', (...args) =>
{
const dissallowedEvents = ["pagehide"]
if (dissallowedEvents.includes(args[0])) return;
// gets the unhooked original function if you need to call it in the hook
const o = hooker.getOriginal("window.addEventListener");
// addEventListener only has either 2 or 3 arguments
if (args.length == 3) o(args[0], args[1], args[2]);
else if (args.length == 2) o(args[0], args[1]);
});