refactor: 移除所有录制功能代码
- 删除录制相关页面组件(RecordReplayPage、ReplayListPage、ReplayPlayerPage) - 删除录制工具文件(recordEventsDb、recordUtils、useRecorder、tabUtils) - 清理 background.ts 和 content.ts 中的录制代码 - 更新 App.tsx 移除录制路由 - 清理 messages.tsx 中的消息定义 - 删除 types.tsx 中的录制状态 - 移除 package.json 中的 rrweb 相关依赖 - 更新 wxt.config.ts 移除 offscreen、downloads 权限 - 删除 offscreen 目录 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-37
@@ -1,45 +1,9 @@
|
||||
import '../.wxt/types/imports.d.ts';
|
||||
import { createRecorder } from '@/utils/useRecorder';
|
||||
import { onMessage } from '@/utils/messages';
|
||||
|
||||
export default defineContentScript({
|
||||
// matches: ['*://*.google.com/*'],
|
||||
matches: ['<all_urls>'],
|
||||
runAt: 'document_start',
|
||||
main() {
|
||||
const recorder = createRecorder();
|
||||
let isRecording = false;
|
||||
|
||||
onMessage('content:check-status', () => {
|
||||
console.log(`[content]${isRecording}`);
|
||||
return isRecording;
|
||||
});
|
||||
|
||||
onMessage('content:start-recording', async () => {
|
||||
try {
|
||||
const started = await recorder.startRecord();
|
||||
if (started) {
|
||||
isRecording = true;
|
||||
return { ok: true };
|
||||
} else {
|
||||
return { ok: false, error: 'Failed to start recorder' };
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error handling start recording:', error);
|
||||
return { ok: false };
|
||||
}
|
||||
});
|
||||
|
||||
onMessage('content:stop-recording', () => {
|
||||
try {
|
||||
console.log('[content] stopRecording received');
|
||||
recorder.stopRecord();
|
||||
isRecording = false;
|
||||
return { ok: true };
|
||||
} catch (error) {
|
||||
console.error('Error handling stop recording:', error);
|
||||
return { ok: false };
|
||||
}
|
||||
});
|
||||
// Content script placeholder
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user