Skip to content

feat: add external automation support with silent tab capture#1

Merged
lmn451 merged 3 commits into
masterfrom
cdp-support
Mar 18, 2026
Merged

feat: add external automation support with silent tab capture#1
lmn451 merged 3 commits into
masterfrom
cdp-support

Conversation

@lmn451
Copy link
Copy Markdown
Owner

@lmn451 lmn451 commented Mar 18, 2026

Summary

Add programmatic control surface for external automation clients via Chrome DevTools Protocol (CDP) and message passing.

  • Add chrome.runtime.onMessageExternal listener for external START/STOP commands
  • Add silent tab capture mode using chrome.tabCapture for mode: 'tab'
  • Suppress preview tab when controlled externally (isAutomation flag)
  • Add GET_LAST_RECORDING_ID message/CDP handler
  • Add tabCapture permission to manifest

Changes

  • background.js - external message handling, automation state, new API handlers
  • offscreen.js - tabCapture support with silent mode fallback
  • recorder.js - tabCapture support for page strategy
  • manifest.json - tabCapture permission
  • README.md - link to CDP documentation
  • CDP.md - new documentation for programmatic control

Usage

// Attach debugger and start recording
await chrome.debugger.attach({ tabId: undefined }, '1.3');
await chrome.debugger.sendCommand(
  { tabId: undefined },
  'CaptureCast.start',
  { mode: 'tab', silent: true }
);

lmn451 added 3 commits March 18, 2026 14:34
- Add debugger permission to manifest.json
- Add attachDebugger() to auto-attach on startup
- Add handleCDPCommand() to route CDP commands:
  - CaptureCast.start({ mode, mic, systemAudio })
  - CaptureCast.stop()
  - CaptureCast.getState()
- Add chrome.debugger.onEvent and onDetach listeners
- Test attachDebugger() with various scenarios
- Test handleCDPCommand() for all CDP methods:
  - CaptureCast.start with default and custom params
  - CaptureCast.stop
  - CaptureCast.getState
  - Unknown commands return error
  - Edge cases (already recording, not recording)
- Add chrome.runtime.onMessageExternal listener for external START/STOP
- Add isAutomation flag to suppress preview tab for automation clients
- Add silent mode using chrome.tabCapture for mode: 'tab'
- Add GET_LAST_RECORDING_ID message handler
- Add CaptureCast.getLastRecordingId CDP command
- Add tabCapture permission to manifest
- Add CDP.md documentation for programmatic control
@lmn451 lmn451 merged commit 425c51f into master Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant