Skip to content

v0.18.0

Choose a tag to compare

@szymdzum szymdzum released this 14 Oct 21:33
· 327 commits to main since this release
eb0032b

bdg v0.18.0

bdg can now attach to the Chrome you already have open (bdg attach), without reloading your tab. Action results are more honest about what happened (form submits, silent DOM changes, blocked submits, tracker noise removed), Ctrl-C now ends every command with a clear envelope or line, and the release workflow is hardened so no project code runs where the npm token exists.

Highlights

  • bdg attach [tab]: list and attach to tabs of your running Chrome (enable chrome://inspect/#remote-debugging, or use --chrome-ws-url / --user-data-dir). Earlier console messages and exceptions are replayed; the page is not reloaded.
  • network list --filter url:<text>: filter by part of the URL as shown, with !url: and *; domain:<host>:<port> now compares the port.
  • Honest action results: Form submitted, Button changed, Activated, Expanded, DOM changed (N nodes), Focus moved to, and Shown: through shadow roots and aria-expanded reveals; repeated beacons share one row; tracker errors are hidden.
  • Ctrl-C everywhere: every interrupted command prints an Interrupted envelope (--json) or one line, dom eval and bdg cdp Runtime.evaluate stop their script on the page, and the next command answers at once.
  • status and peek show a page that is still loading, with what it waits on; peek --json timestamp is the snapshot time.
  • Safer big results: dom eval --full and bdg cdp refuse over-large results with exit 81 instead of running out of memory, and a frozen Chrome ends the session with a clear reason.
  • Secrets stay hidden in start errors (no URL credentials or tokens).
  • Release workflow hardening: build and publish are separate jobs, actions are pinned to commit SHAs, and there is a dry-run input.

Breaking changes

  • Bare bdg --json and bdg <group> --json (bdg page --json, dom, network, state, css) return an error envelope and exit 81 instead of help with exit 0. Run bdg --help --json for the help document.
  • Help JSON options is an array everywhere ({flags, description, required, takesValue, optional}); the compact root help used a map. Read it as an array.
  • Page-code failures during an action exit 91, not 110 (dom pressKey on a page that replaced built-ins exits 90). Match 91 (and 90).
  • --chrome-ws-url: a declined "Allow remote debugging?" prompt exits 82 and an unanswered one 102 after 30 s, with one connection attempt (was two, 5 s handshake timeout). Handle 82 and 102 where you start with --chrome-ws-url.
  • A --filter with an odd number of " exits 81. Close the quote, or write "url:a b".
  • dom screenshot --follow exits 130 / 143 on Ctrl-C / SIGTERM (was 0 / killed).
  • dom eval no longer leaves top-level const, let or class on the page. Use window.x = … to share state between evals.

Install

npm install -g browser-debugger-cli

Full changelog: https://github.com/szymdzum/browser-debugger-cli/blob/main/CHANGELOG.md

Compare: v0.17.0...v0.18.0