Repository navigation
v0.43.0 — iframe downloads, exact PDF trims, sticky mobile viewport, richer cdp_send
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 / sandboxedsrcdociframe. A bare XPath only searched the main frame, so a download button inside an OOPIF (embedded viewers, preview shells, "publish a page" products) came backnot found. Passframe— same semantics asjs_evaluate's (a URL substring likesrcdoc, 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_sendreaches CDP methods with array-of-objects params. A method likeEmulation.setEmulatedMedia(whosefeaturesis a list of typed objects) failed with'dict' object has no attribute 'to_json'— the parsed JSON reached the binding as plain dicts.cdp_sendnow rebuilds object / list-of-object params into the binding's typed classes from its type hints (primitives and enums pass through untouched).
Fixed
-
page_pdfexplicit 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-sizenow means "defer to the DOCUMENT's own@page". -
An explicit narrow/mobile
window_setviewport persists.get_active_tabre-applied the desktop default (1600×950) on every call wheninnerWidth < 1000, sowindow_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)thenjs_evaluatesees the mobile layout, across navigation. A freshbrowser_startclears it.
pip install -U ai-dev-browser # 0.43.0