脚本打包
Some checks failed
build / Build (push) Failing after 6s
test / Run tests (push) Failing after 8s

This commit is contained in:
2025-04-09 22:33:46 +08:00
parent 0d86dae710
commit 259917545e
16 changed files with 540 additions and 125 deletions

View File

@ -21,8 +21,8 @@ export default class GMApi {
readyState: <any>xhr.readyState,
status: xhr.status,
statusText: xhr.statusText,
// header由service_worker处理
// responseHeaders: xhr.getAllResponseHeaders().replace(removeXCat, ""),
// header由service_worker处理但是存在特殊域名例如edge.microsoft.com无法获取的情况在这里增加一个默认值
responseHeaders: xhr.getAllResponseHeaders(),
responseType: details.responseType,
};
if (xhr.readyState === 4) {

View File

@ -168,7 +168,7 @@ export default class GMApi {
"headersReceived:" + requestId,
(details: chrome.webRequest.WebResponseHeadersDetails) => {
details.responseHeaders?.forEach((header) => {
responseHeader += header.name + ": " + header.value + "\n";
responseHeader += header.name + ": " + header.value + "\r\n";
});
this.gmXhrHeadersReceived.removeAllListeners("headersReceived:" + requestId);
}
@ -178,7 +178,9 @@ export default class GMApi {
offscreenCon.onMessage((msg: { action: string; data: any }) => {
// 发送到content
// 替换msg.data.responseHeaders
msg.data.responseHeaders = responseHeader;
if (responseHeader) {
msg.data.responseHeaders = responseHeader;
}
con.getConnect().sendMessage(msg);
});
}

View File

@ -194,8 +194,6 @@ export class RuntimeService {
})
);
console.log("pageLoad", enableScript);
this.mq.emit("pageLoad", {
tabId: chromeSender.tab?.id,
frameId: chromeSender.frameId,

View File

@ -57,7 +57,6 @@ export class ValueService {
valueModel.data[key] = value;
await this.valueDAO.save(storageName, valueModel);
}
console.log(valueModel);
return true;
});
const sendData: ValueUpdateData = {