调整通信
Some checks failed
test / Run tests (push) Failing after 15s
build / Build (push) Failing after 19s

This commit is contained in:
2025-03-22 02:50:56 +08:00
parent 131f1bda40
commit 57bef5a023
27 changed files with 301 additions and 203 deletions

View File

@ -35,6 +35,9 @@ export class ExtensionMessage extends ExtensionMessageSend implements Message {
// 注意chrome.runtime.onMessage.addListener的回调函数需要返回true才能处理异步请求
onMessage(callback: (data: any, sendResponse: (data: any) => void) => void) {
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
if (msg.action === "messageQueue") {
return false;
}
return callback(msg, sendResponse);
});
}