代码拉取完成,页面将自动刷新
同步操作将从 healthy/ajax-hook 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
interface XMLHttpRequestProxy extends XMLHttpRequest {
responseText: string,
readyState: number;
response: any;
responseURL: string;
responseXML: Document | null;
status: number;
statusText: string;
xhr: OriginXMLHttpRequest
}
interface OriginXMLHttpRequest extends XMLHttpRequest {
getProxy(): XMLHttpRequestProxy;
}
interface AttrGetterAndSetter<T = any> {
getter?: (value: T, xhr: OriginXMLHttpRequest) => T;
setter?: (value: T, xhr: OriginXMLHttpRequest) => T;
}
interface XhrRequestConfig {
method: string,
url: string,
headers: any,
body: any,
async: boolean,
user: string,
password: string,
withCredentials: boolean
xhr: OriginXMLHttpRequest,
}
interface XhrResponse {
config: XhrRequestConfig,
headers: any,
response: any,
status: number,
statusText?: string,
}
type XhrErrorType = 'error' | 'timeout' | 'abort'
interface XhrError {
config: XhrRequestConfig,
type: XhrErrorType
}
interface Hooks {
onreadystatechange?: ((this: XMLHttpRequestProxy, xhr: OriginXMLHttpRequest, ev: ProgressEvent) => any) | null;
onabort?: ((this: XMLHttpRequestProxy, xhr: OriginXMLHttpRequest, ev: ProgressEvent) => any) | null;
onerror?: ((this: XMLHttpRequestProxy, xhr: OriginXMLHttpRequest, ev: ProgressEvent) => any) | null;
onload?: ((this: XMLHttpRequestProxy, xhr: OriginXMLHttpRequest, ev: ProgressEvent) => any) | null;
onloadend?: ((this: XMLHttpRequestProxy, xhr: OriginXMLHttpRequest, ev: ProgressEvent) => any) | null;
onloadstart?: ((this: XMLHttpRequestProxy, xhr: OriginXMLHttpRequest, ev: ProgressEvent) => any) | null;
onprogress?: ((this: XMLHttpRequestProxy, xhr: OriginXMLHttpRequest, ev: ProgressEvent) => any) | null;
ontimeout?: ((this: XMLHttpRequestProxy, xhr: OriginXMLHttpRequest, ev: ProgressEvent) => any) | null;
abort?: ((args: Array<any>, xhr: OriginXMLHttpRequest) => any);
getAllResponseHeaders?: (args: Array<any>, xhr: OriginXMLHttpRequest) => any;
getResponseHeader?: (args: Array<any>, xhr: OriginXMLHttpRequest) => any;
open?: (args: Array<any>, xhr: OriginXMLHttpRequest) => any;
overrideMimeType?: (args: Array<any>, xhr: OriginXMLHttpRequest) => any;
send?: (args: Array<any>, xhr: OriginXMLHttpRequest) => any;
setRequestHeader?: (args: Array<any>, xhr: OriginXMLHttpRequest) => any;
addEventListener?: (args: Array<any>, xhr: OriginXMLHttpRequest) => any;
removeEventListener?: (args: Array<any>, xhr: OriginXMLHttpRequest) => any;
response?: AttrGetterAndSetter,
responseText?: AttrGetterAndSetter<string>,
readyState?: AttrGetterAndSetter<number>,
responseType?: AttrGetterAndSetter<XMLHttpRequestResponseType>;
responseURL?: AttrGetterAndSetter<string>;
responseXML?: AttrGetterAndSetter<Document | null>;
status?: AttrGetterAndSetter<number>;
statusText?: AttrGetterAndSetter<string>;
timeout?: AttrGetterAndSetter<number>;
upload?: AttrGetterAndSetter<XMLHttpRequestUpload>;
withCredentials?: AttrGetterAndSetter<boolean>;
}
interface XhrHandler {
resolve(response: XhrResponse): void
reject(err: XhrError): void
}
interface XhrRequestHandler extends XhrHandler {
next(config: XhrRequestConfig): void
}
interface XhrResponseHandler extends XhrHandler {
next(response: XhrResponse): void
}
interface XhrErrorHandler extends XhrHandler {
next(error: XhrError): void
}
interface Proxy {
onRequest?: (config: XhrRequestConfig, handler: XhrRequestHandler) => void,
onResponse?: (response: XhrResponse, handler: XhrResponseHandler) => void,
onError?: (err: XhrError, handler: XhrErrorHandler) => void,
}
export function proxy(proxy: Proxy, win?: Window): { originXhr: XMLHttpRequest, unProxy: () => void };
export function unProxy(win?: Window);
export function hook(hooks: Hooks,win?: Window): { originXhr: XMLHttpRequest, unHook: () => void };
export function unHook(win?: Window);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。