feat: implement screen recording via chrome.tabCapture with offscreen document

- Use chrome.tabCapture.getMediaStreamId() from service worker
- Pass stream ID to offscreen document for MediaRecorder
- Recording survives page navigation (unlike getDisplayMedia)
- Requires user to click extension icon first (activeTab permission)
- Add esbuild to build offscreen.ts separately
- Update prompt docs with recording instructions
This commit is contained in:
Tommy D. Rossi
2026-01-23 16:57:51 +01:00
parent e56e27e5e5
commit 74497c2a1a
8 changed files with 210 additions and 278 deletions
+2 -5
View File
@@ -19,13 +19,10 @@ export interface ExtensionState {
}
/**
* Recording state - kept separate from store since MediaRecorder/MediaStream can't be serialized.
* Note: MediaRecorder and MediaStream types are available in the extension's browser context.
* Recording state - stored in service worker to track active recordings.
* The actual MediaRecorder/MediaStream live in the offscreen document.
*/
export interface RecordingInfo {
tabId: number
startedAt: number
recorder: any // MediaRecorder - using any to avoid DOM type dependency
stream: any // MediaStream - using any to avoid DOM type dependency
mimeType: string
}