Context
Continued from prior session that migrated browser-agent from Tampermonkey to MV3 extension (v2.0.0). This session added CDP (Chrome DevTools Protocol) enhancements to solve FB Marketplace automation challenges: CSP-blocked eval, timer throttling on unfocused tabs, and React event delegation issues.
What Was Built
- cdpEval — Run arbitrary JS via CDP Runtime.evaluate, bypasses Content Security Policy on Facebook/Google Photos/Deepgram
- cdpKeys — Send special keystrokes (ArrowDown, Enter, Tab, Escape) via CDP Input.dispatchKeyEvent
- mouseMoved in CDP click — React event delegation requires mouseMoved before mousePressed for dialog item clicks to register
- Fixed double character insertion — CDP keyDown with text + char event both inserted characters; removed text from keyDown
Key Discovery: FB Category Picker
FB Marketplace Category field is a dialog picker (not autocomplete). Clicking the combobox opens a scrollable dialog with [role=”button”] items organized by section. Must click the button element, not the text. Condition field IS a standard dropdown with [role=”option”] elements.
Result
Successfully posted FB Marketplace listing (Eufy Smart Scale, $10) using all-CDP workflow. Extension version bumped from 2.0.0 to 2.2.0.
Commits
- 2b2634c — Add cdpEval and cdpKeys commands
- fc396eb — v2.1.0: mouseMoved in CDP click
- 501be8d — v2.2.0: fix double char insertion
- 531cff4 — Doc updates
Open Items
- Update fb-marketplace-poster to use CDP commands for category selection
- Add –await flag to cdp-eval CLI for promise support
- Consider routing content script polling through background worker to bypass timer throttling