refactor(storage): 将storage工具类重命名为chromeStorage

重命名utils/storage.ts为utils/chromeStorage.ts以更好地反映其功能用途

feat(messages): 简化消息协议定义并移除过时的消息类型

将messages.tsx中的硬编码消息对象替换为ProtocolMap接口定义,
移除了不再使用的popup、content和offscreen相关消息类型,
使消息系统更加简洁和类型安全
```
This commit is contained in:
雨霖铃
2026-02-26 17:15:20 +08:00
parent c848003214
commit 6d2b553ca4
3 changed files with 1 additions and 33 deletions
-32
View File
@@ -1,37 +1,5 @@
import { defineExtensionMessaging } from '@webext-core/messaging';
export const messages = {
popup: {
from: {
start: 'popup:start',
stop: 'popup:stop',
},
to: {
stopped: 'popup:stopped',
started: 'popup:started',
tabChanged: 'popup:tab-changed',
},
checkStatus: 'popup:check-status',
ready: 'popup:ready',
},
content: {
from: {
saveTrackEvents: 'content:save-track-events',
},
to: {
startRecording: 'content:start-recording',
stopRecording: 'content:stop-recording',
},
checkStatus: 'content:check-status',
},
offscreen: {
to: {
startRecording: 'offscreen:start-recording',
stopRecording: 'offscreen:stop-recording',
},
},
};
interface ProtocolMap {
// --- Popup 相关 ---
'popup:start': () => { ok: boolean; error?: string };