Greasy Fork is available in English.

XHR_INTERCEPTOR

XHR请求拦截工具类

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.greasyfork.org/scripts/494576/1377969/XHR_INTERCEPTOR.js

作者
Zosah
版本
1.0.0
建立日期
2024-05-10
更新日期
2024-05-17
授權條款
未知

使用

// @run-at document-start

const xhrInterceptor = new XMRInterceptor();
xhrInterceptor.addUrlInterceptor({
    domain: "baidu.com",
    url: "/search?a=1",
    cb: (response) => {
        console.log('====> ok', response);
    },
});
xhrInterceptor.execute();