Commit Graph

2 Commits

Author SHA1 Message Date
jackwener 35ff2b65fb fix: context isolation, initial sync, cookie batching, camoufox stop
Critical fixes:
- CamoufoxPool: shared browser/context singleton — LiveSyncService and
  CamoufoxBridge now share the same context, so real-time synced cookies
  are visible to adapter pages
- CamoufoxBridge uses pool instead of creating isolated contexts
- LiveSyncService: initial full export-state from Chrome before watching
- Cookie debounce batching: 50ms window with deduplication
- camoufox stop command: finds and kills server process
- Python launcher: Windows-compatible (threading.Event vs signal.pause)
2026-03-22 21:08:49 +08:00
jackwener 61b7a804f3 feat: real-time sync, P0 bug fixes, camoufox improvements
Bug fixes:
- CamoufoxPage.evaluate() now uses wrapForEval() for consistency
- Cookie import order: addCookies BEFORE navigate
- camoufox start: use Python launcher for reliable WS path parsing
- --no-headless flag (was broken with default=true)

Real-time sync (daemon architecture):
- Extension: chrome.cookies.onChanged → SyncEvent → daemon
- Extension: watch-state/unwatch-state commands, domain filtering
- Daemon: /sync WebSocket path for sync subscribers
- LiveSyncService: subscribes to daemon, applies events to camoufox
- CLI: opencli browser watch --domain github.com

Improvements:
- scripts/camoufox_server.py: reliable launcher via launch_server()
- protocol.ts: SyncEvent type for real-time state changes
- BROWSER-STATE-SYNC.md: comprehensive implementation docs
2026-03-22 14:36:31 +08:00