This commit is contained in:
zhu
2026-05-06 10:22:38 +08:00
parent 350d4fc2e2
commit 53e4f0b2f4
10 changed files with 256 additions and 183 deletions

View File

@@ -1,4 +1,4 @@
import { handleBackgroundCommand, handleInstalled, handleStartup, handleWindowRemoved } from './service';
import { handleBackgroundCommand, handleInstalled, handleStartup, handleWindowRemoved } from './service';
import type { BackgroundCommand } from './types';
chrome.runtime.onInstalled.addListener(() => {
@@ -18,7 +18,9 @@ chrome.windows.onRemoved.addListener((windowId) => {
void handleWindowRemoved(windowId);
});
/** 统一包装后台消息处理,确保异步错误能回给调用方。 */
/**
* 统一包装后台消息处理,确保异步错误能回给调用方。
*/
async function handleBackgroundMessage(
message: BackgroundCommand,
sendResponse: (response?: unknown) => void,