a
Some checks failed
test / Run tests (push) Failing after 13s
build / Build (push) Failing after 13s

This commit is contained in:
2025-02-14 18:04:37 +08:00
parent 7697c91d95
commit 6d983ed0e4
2 changed files with 62 additions and 14 deletions

View File

@ -3,13 +3,17 @@ import { Group } from "@Packages/message/server";
export class GMApi {
constructor(private group: Group) {}
xmlHttpRequest(){
xmlHttpRequest(params: GMSend.XHRDetails) {
console.log(params);
const xhr = new XMLHttpRequest();
xhr.open(params.method || "GET", params.url);
xhr.onload = function () {
console.log(xhr, xhr.getAllResponseHeaders());
};
xhr.send();
}
init() {
this.group.on("xmlHttpRequest", async (data) => {
console.log(data);
});
this.group.on("xmlHttpRequest", this.xmlHttpRequest.bind(this));
}
}