Skip to content

v0.2.1 — Fix Target reloaded on freshly-created targets

Choose a tag to compare

@olimsaidov olimsaidov released this 13 Jun 15:55
· 11 commits to master since this release
c9be76b

Patch: don't re-probe an already-connected Target on iframe load

Fixes a handshake race that the v0.2.0 onCreateTarget flow exposes: a Client that creates a Target and immediately drives it (e.g. agent-browser tab new <url>) could fail its first command with Target reloaded (typically on Page.enable).

Cause: the Host re-probed a Pairing on every iframe load event. For a freshly paired iframe, the agent's boot hello already connected the channel before load fired, so the re-probe drew a second hello — which the Host treats as a reload and uses to fail in-flight commands.

Fix: re-probe on load only when there is no channel yet. A connected pairing is left untouched; a genuine reload still reconnects via the new document's own boot hello.

No API changes. Recommended for anyone using onCreateTarget / pairing freshly-created iframes.

Full diff: v0.2.0...v0.2.1