Skip to content

v0.0.5

Latest

Choose a tag to compare

@github-actions github-actions released this 18 May 15:06
7a98788

v0.0.5

Highlights

  • CDP attach (borrow a user's running Chrome) — New Browser(cdp=...) / --cdp <input> flag lets bridgic connect to an already-running Chrome instance instead of launching its own. Accepts a port (9222), a file (/path/to/devtools.json), a service-discovery hint, or auto-scan via find_cdp_url(). Ownership-aware: tabs the user opened before bridgic attached stay invisible to get_tabs / close_tab (privacy boundary). On disconnect, bridgic's per-tab state is cleaned up but the user's Chrome keeps running. See docs/CDP_MODE.md.

  • Silent downloads in CDP-borrowed mode — Downloads triggered from bridgic's tab no longer pop the "Where to save?" dialog under Chrome 138+ with "Ask where to save each file" enabled. Implementation routes Browser.setDownloadBehavior(allowAndName) over the page-level CDP session and uses CdpDownloadRenamer to rename the GUID stub to the real filename. Working dir resolves via constructor → per-command client_cwd (CLI sends os.getcwd() per request) → ~/Downloads. User's other tabs keep their normal Chrome UX.

  • Background snapshot pre-warmingnavigate_to / search now kick off a background snapshot generation so the next get_snapshot / get_snapshot_text call returns immediately. Three-phase evaluate fixes a roleIndex rebuild regression on large pages (DOM-heavy sites went from multi-second to sub-second snapshot times).

  • Mode-aware stealth — Anti-detection JS init script now runs only in headless mode, where it's needed; headed mode skips it because the same add_init_script() runs inside cross-origin Cloudflare Turnstile iframes and causes detectable inconsistencies. Race-proof worker stealth (page.on('worker') listener + Worker/SharedWorker/serviceWorker.register wrap), CDP Emulation.setUserAgentOverride for headless UA cleanup, and a new anti-toString _mkNative wrapper that returns the proper "function name() { [native code] }" string for every patched function (defeats DataDome / PerimeterX / Cloudflare .toString() probing).

  • Video recording — New start_video / stop_video tools record any active tab via CDP screencast → ffmpeg pipeline. In CDP-borrowed mode, all visible tabs (bridgic-owned and user-owned) can be recorded.

  • BRIDGIC_HOME env var — All daemon state paths (socket, run info, logs, tmp, user config, user data) now derive from $BRIDGIC_HOME (default ~/.bridgic). Set different values to run multiple independent daemon instances side-by-side without socket / lock collisions.

Bug fixes

  • Headed launch SIGTRAP on macOS 26bridgic-browser open <url> with headless=false could crash with bug_type=309 EXC_BREAKPOINT/SIGTRAP on first launch of the Playwright-bundled Chrome for Testing binary, producing BROWSER_CLOSED after 3 internal retries. The auto-switch to Apple-notarized system Chrome now triggers in all headed launches (previously required stealth=true). Users who must keep bundled Chromium can opt out via channel="chromium" or executable_path.

  • SingletonLock crash between headed/headless on same machineuser_data_dir is now split into mode-specific <base>/headed and <base>/headless subdirs. Public Browser.user_data_dir property still returns the base path users provided.

  • go_back / go_forward false positive on same-document navigation — Was reporting success when only the hash fragment changed but no actual navigation occurred.

  • CDP auto-reconnect — Daemon now recovers from transient CDP socket drops instead of stuck-closed state.

  • evaluate_javascript parity with page.evaluate in CDP mode — Including arrow-function shorthand () => ... argument passing.

  • dropdown_select on custom comboboxes — Hidden shadow <select> options were leaking into the candidate list; now filtered out.

  • Six follow-up bugs from PR #21 CR: eval exceptionDetails handling, go_back/forward None return, CDP session leak, video context binding, download timeout, probe timeout.

  • Four CLI freeze/hang root causes identified from production daemon.log analysis.

  • Snapshot deadlock, download / video lifecycle, CDP URL redaction in logs.

CLI

  • --cdp <input> on open / search to attach to an existing Chrome. Accepts port, file path, or auto scan.
  • Per-command client_cwd plumbed via socket request — bridgic-browser commands now feel curl -O-style for downloads (files land where you ran the command).
  • 7-variant mode-matrix QA harness under scripts/qa/ covers all link modes × display modes (bash scripts/qa/run-mode-matrix.sh).

Tests & docs

  • Comprehensive test coverage for CDP scenarios, lifecycle contracts (I11–I15), mode matrix (V1–V7).
  • docs/CDP_MODE.md — full CDP attach guide.
  • docs/INTERNALS.md — owned-page tracking, ref system, stealth design, CLI architecture deep dives.
  • docs/KNOWN_LIMITATIONS.md — capability boundaries (e.g. Chrome "Show in Folder" bug under CDP).
  • README adds BRIDGIC_HOME multi-instance section, storage-state cross-instance login sharing guide.

Upgrade

  • Run bridgic-browser close before upgrading — daemon code paths changed, the old daemon may not handle the new request shape cleanly.
  • Existing user_data_dir profiles are auto-migrated on first use: bridgic creates <base>/headed and <base>/headless subdirs and lazy-uses whichever matches the current mode. Old top-level profile files are left in place but ignored.
  • cdp_url was renamed to cdp in the SDK and CLI for consistency. If you wrote dev-build code against cdp_url, switch to cdp.

Full Changelog: v0.0.4...v0.0.5