添加测试
Some checks failed
build / Build (push) Failing after 7s
test / Run tests (push) Failing after 10s
Some checks failed
build / Build (push) Failing after 7s
test / Run tests (push) Failing after 10s
This commit is contained in:
@ -13,6 +13,7 @@ export class GMApi {
|
||||
}
|
||||
}
|
||||
xhr.onload = function () {
|
||||
console.log(xhr.getAllResponseHeaders());
|
||||
con?.sendMessage({
|
||||
action: "onload",
|
||||
data: {
|
||||
|
@ -83,6 +83,7 @@ export class Runtime {
|
||||
return this.execScript(script);
|
||||
} else {
|
||||
// 定时脚本加入定时任务
|
||||
await this.stopCronJob(script.uuid);
|
||||
return this.crontabScript(script);
|
||||
}
|
||||
}
|
||||
|
@ -148,10 +148,17 @@ export default class GMApi {
|
||||
}
|
||||
params.headers["X-Scriptcat-GM-XHR-Request-Id"] = requestId.toString();
|
||||
await this.buildDNRRule(requestId, request.params[0]);
|
||||
let responseHeader = "";
|
||||
// 等待response
|
||||
this.gmXhrHeadersReceived.addListener("headersReceived:" + requestId, (details) => {
|
||||
console.log("处理", details);
|
||||
});
|
||||
this.gmXhrHeadersReceived.addListener(
|
||||
"headersReceived:" + requestId,
|
||||
(details: chrome.webRequest.WebResponseHeadersDetails) => {
|
||||
details.responseHeaders?.forEach((header) => {
|
||||
responseHeader += header.name + ": " + header.value + "\n";
|
||||
});
|
||||
console.log("处理", details, responseHeader);
|
||||
}
|
||||
);
|
||||
// 再发送到offscreen, 处理请求
|
||||
const offscreenCon = await connect(this.sender, "gmApi/xmlHttpRequest", request.params[0]);
|
||||
offscreenCon.onMessage((msg) => {
|
||||
|
Reference in New Issue
Block a user