inject的GM API调用
Some checks failed
build / Build (push) Failing after 7s
test / Run tests (push) Failing after 8s
Some checks failed
build / Build (push) Failing after 7s
test / Run tests (push) Failing after 8s
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Group, MessageConnect } from "@Packages/message/server";
|
||||
import { GetSender, Group, MessageConnect } from "@Packages/message/server";
|
||||
|
||||
export default class GMApi {
|
||||
constructor(private group: Group) {}
|
||||
@ -24,8 +24,9 @@ export default class GMApi {
|
||||
return response;
|
||||
}
|
||||
|
||||
xmlHttpRequest(details: GMSend.XHRDetails, con: MessageConnect | null) {
|
||||
xmlHttpRequest(details: GMSend.XHRDetails, sender: GetSender) {
|
||||
const xhr = new XMLHttpRequest();
|
||||
const con = sender.getConnect();
|
||||
xhr.open(details.method || "GET", details.url);
|
||||
// 添加header
|
||||
if (details.headers) {
|
||||
@ -34,7 +35,7 @@ export default class GMApi {
|
||||
}
|
||||
}
|
||||
xhr.onload = () => {
|
||||
this.dealXhrResponse(con!, details, "onload", xhr);
|
||||
this.dealXhrResponse(con, details, "onload", xhr);
|
||||
};
|
||||
xhr.onloadstart = () => {
|
||||
this.dealXhrResponse(con!, details, "onloadstart", xhr);
|
||||
|
Reference in New Issue
Block a user