本帖最后由 iuiiuiiiu 于 2024-4-18 20:39 编辑
提示 eventTrigger 未定义,如图:
页面出错截图:
脚本:
// ==UserScript==
// @name Test ajaxHooker
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Test ajaxHooker
// @author Your Name
// @match *://*.paypal.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @require https://scriptcat.org/lib/637/1.3.4/ajaxHooker.js#sha256=fWw0ORFWJPYQXZqlv9oxxC96PK/oGwgVpiWCDaC3YPU=
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
//ajaxHooker.protect();
ajaxHooker.hook(request => {
request.abort=false
console.log("【拦截类型】:", request.type);
console.log("【异步:true,同步:false】:", request.async);
console.log("【请求 URL】:", request.url);
console.log("【方法 Method】:", request.method);
console.log("【请求头】:", request.headers);
console.log("【请求携带的数据】:", request.data);
request.response = res => {
console.log(res);
// res.responseText += 'test';
};
});
// Your code here...
})();