Skip to content

v0.2.11: Fix browser automation when Chrome is minimized

Choose a tag to compare

@mikuh mikuh released this 26 Feb 02:32
· 2 commits to main since this release

What's Changed

Bug Fix: Chrome minimized support

Previously, browser-ctl commands would hang or fail when Chrome was minimized because several rendering-dependent APIs don't work on hidden pages:

  • requestAnimationFrame callbacks are paused → stability checks hung indefinitely
  • document.elementFromPoint() returns null → hit-test always failed
  • offsetParent / getBoundingClientRect() may return incorrect values

Changes

  • click.js: Skip rAF stability check and elementFromPoint hit-test when document.hidden is true
  • content-script.js: Same fix for all actionability checks (ensureActionable) — affects click, dblclick, hover, drag, type, focus, check/uncheck, and snapshot
  • actions.js: Add CDP fallback for doScreenshot() — uses Page.captureScreenshot when captureVisibleTab fails (minimized window)

All commands now work correctly with Chrome minimized or in a background desktop.