Skip to content

v0.43.0 — iframe downloads, exact PDF trims, sticky mobile viewport, richer cdp_send

Choose a tag to compare

@elfenlieds7 elfenlieds7 released this 24 Sep 11:58
· 193 commits to master since this release

v0.43.0 — iframe downloads, exact PDF trims, sticky mobile viewport, richer cdp_send

Four fixes from a print-and-preview consumer's dogfooding — the obvious call is now the correct one in each case.

Added

  • download_link(frame=...) reaches a control inside a cross-origin / sandboxed srcdoc iframe. A bare XPath only searched the main frame, so a download button inside an OOPIF (embedded viewers, preview shells, "publish a page" products) came back not found. Pass frame — same semantics as js_evaluate's (a URL substring like srcdoc, or the target id) — and the locate + trusted click run in that frame's own session, with the download armed there too so completion is actually reported. Lets you verify a real end-user download inside a sandbox instead of faking it with a synthetic click.

  • cdp_send reaches CDP methods with array-of-objects params. A method like Emulation.setEmulatedMedia (whose features is a list of typed objects) failed with 'dict' object has no attribute 'to_json' — the parsed JSON reached the binding as plain dicts. cdp_send now rebuilds object / list-of-object params into the binding's typed classes from its type hints (primitives and enums pass through untouched).

Fixed

  • page_pdf explicit sizes are now pixel-exact. --paper card-cn (and any metric/fractional --paper-width) previously went through printToPDF's inches path, which Chrome rounds — a card landed 256.08 × 154.08pt, ~0.34mm over on both axes, silently. The obvious call now applies its size via an injected @page { size } rule, which Chrome honors exactly (255.12 × 153.07pt). --prefer-css-page-size now means "defer to the DOCUMENT's own @page".

  • An explicit narrow/mobile window_set viewport persists. get_active_tab re-applied the desktop default (1600×950) on every call when innerWidth < 1000, so window_set(width=390) was clobbered on the next call — mobile-layout verification (and width media queries) was impossible. The explicit viewport is now recorded per instance and re-asserted every call; window_set(390,844) then js_evaluate sees the mobile layout, across navigation. A fresh browser_start clears it.

pip install -U ai-dev-browser   # 0.43.0