XHR_INTERCEPTOR

XHR请求拦截工具类

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/494576/1377969/XHR_INTERCEPTOR.js

Author
Zosah
Version
1.0.0
Created
2024-05-10
Updated
2024-05-17
License
N/A

使用

// @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();