您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hook most functions on runtime via the function name
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/469993/1214452/FunctionHookerjs.js
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]);
});